Skip to content

Commit f2400ef

Browse files
authored
Update versioning scheme in Directory.Build.props
This makes it simpler to use --prerelease with dnx to run tools from CI builds
1 parent 95b338b commit f2400ef

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/Directory.Build.props

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project>
1+
<Project TreatAsLocalProperty="VersionPrefix">
22
<!-- To extend/change the defaults, create a Directory.props alongside this file -->
33

44
<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
@@ -136,6 +136,15 @@
136136
<VersionSuffix Condition="!$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</VersionSuffix>
137137
<!-- Special case for tags, the label is actually the version. Backs compat since passed-in value overrides MSBuild-set one -->
138138
<Version Condition="$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</Version>
139+
140+
<!-- In order for latest from main/master to always be greatest when using -prerelease switch on install/run,
141+
we change the scheme as follows:
142+
- main/master remain as today: VersionPrefix: 42.42.${{ github.run_number }} (from yaml)
143+
- others: VersionPrefix: 42.42.0-[label].${{ github.run_number }}
144+
-->
145+
<IsMaster Condition="$(VersionLabel.Contains('refs/heads/main')) or $(VersionLabel.Contains('refs/heads/master'))">true</IsMaster>
146+
<VersionPrefix Condition="'$(IsMaster)' != 'true'">42.42.0</VersionPrefix>
147+
<VersionSuffix Condition="'$(IsMaster)' != 'true'">$(VersionSuffix).$(GITHUB_RUN_NUMBER)</VersionSuffix>
139148
</PropertyGroup>
140149

141150
<ItemGroup Label="ThisAssembly.Project">

0 commit comments

Comments
 (0)