forked from openiddict/openiddict-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Directory.Build.props
46 lines (39 loc) · 2.13 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<PropertyGroup>
<LangVersion>preview</LangVersion>
<NoWarn>$(NoWarn);CS1591;NU5128</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>false</SignAssembly>
<DelaySign>false</DelaySign>
<PublicSign>false</PublicSign>
</PropertyGroup>
<PropertyGroup>
<RepoRelativeProjectDir>$([MSBuild]::MakeRelative($(RepoRoot), $(MSBuildProjectDirectory)))</RepoRelativeProjectDir>
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
</PropertyGroup>
<!--
Arcade only allows the revision to contain up to two characters, and GitHub Actions does not roll-over
build numbers every day like Azure DevOps does. To balance these two requirements, set the official
build ID to be the same format as the built-in default from Arcade, except with the revision number
being the number of the quarter hour of the current time of day (24 * 4 = 96, which is less than 100).
So a build between 00:00 and 00:14 would have a revision of 1, and a build between 23:45 and 23:59:59
would have a revision of 97.
-->
<PropertyGroup Condition=" '$(GITHUB_ACTIONS)' == 'true' AND '$(GITHUB_REF.StartsWith(`refs/pull/`))' == 'false' ">
<_Hours>$([MSBuild]::Multiply($([System.DateTime]::Now.ToString(HH)), 4))</_Hours>
<_QuarterHours>$([MSBuild]::Divide($([System.DateTime]::Now.ToString(mm)), 15))</_QuarterHours>
<_QuarterHours>$([System.Math]::Floor($(_QuarterHours)))</_QuarterHours>
<_GitHubActionsBuildRevision>$([MSBuild]::Add($(_Hours), $(_QuarterHours)))</_GitHubActionsBuildRevision>
<_GitHubActionsBuildRevision>$([MSBuild]::Add($(_GitHubActionsBuildRevision), 1))</_GitHubActionsBuildRevision>
<OfficialBuild>true</OfficialBuild>
<OfficialBuildId>$([System.DateTime]::Now.ToString(yyyyMMdd)).$(_GitHubActionsBuildRevision)</OfficialBuildId>
</PropertyGroup>
<ItemGroup>
<ProjectCapability Include="DynamicDependentFile" />
<ProjectCapability Include="DynamicFileNesting" />
</ItemGroup>
</Project>