forked from andrewdavey/postal
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Directory.Build.props
32 lines (32 loc) · 1.38 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
<Project>
<PropertyGroup>
<MsBuildAllProjects>$(MsBuildAllProjects);$(MsBuildThisFileFullPath)</MsBuildAllProjects>
<VersionPrefix>4.0.0-beta.1</VersionPrefix>
</PropertyGroup>
<PropertyGroup>
<TODAY>$([System.DateTime]::Now.ToString("yyyyMMdd"))</TODAY>
<InformationalVersion Condition=" '$(SHORT_SHA)' != '' ">$(InformationalVersion)git:$(SHORT_SHA)</InformationalVersion>
</PropertyGroup>
<Choose>
<When Condition=" '$(Prerelease)' != '' ">
<PropertyGroup>
<!-- Prerelease version numbers are MAJOR.MINOR.0-pre-build###### -->
<VersionSuffix>$(Prerelease)-build$(BUILD_BUILDID.PadLeft(2, '0'))</VersionSuffix>
<VersionSuffix Condition=" '$(SHORT_SHA)' != '' ">$(Prerelease)-$(SHORT_SHA)</VersionSuffix>
</PropertyGroup>
</When>
<When Condition=" '$(GITHUB_RELEASE)' == 'true' ">
<PropertyGroup>
<VersionSuffix/>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<!-- append the build number if it is available -->
<VersionSuffix Condition=" '$(GITHUB_RUN_NUMBER)' != '' ">$(VersionSuffix)$(GITHUB_RUN_NUMBER)</VersionSuffix>
<VersionSuffix Condition=" '$(SHORT_SHA)' != '' ">$(VersionSuffix)-$(SHORT_SHA)</VersionSuffix>
<VersionSuffix Condition=" '$(VersionSuffix)' == '' ">build-$(TODAY)</VersionSuffix>
</PropertyGroup>
</Otherwise>
</Choose>
</Project>