Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update how BuildNumbers are calculated #2125

Merged
merged 2 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions .props/_GlobalStaticVersion.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
Update for every public release.
-->
<SemanticVersionMajor>2</SemanticVersionMajor>
<SemanticVersionMinor>16</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionMinor>17</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
<SemanticVersionPatch>0</SemanticVersionPatch>
<PreReleaseMilestone></PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone>beta1</PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
<PreReleaseMilestone Condition="'$(NightlyBuild)' == 'True'">nightly</PreReleaseMilestone> <!-- Overwrite this property for nightly builds from the DEVELOP branch. -->
<!--
Date when Semantic Version was changed.
Expand All @@ -22,13 +22,16 @@
as it will restart file versions so 2.4.0-beta1 may have higher
file version (like 2.4.0.2222) than 2.4.0-beta2 (like 2.4.0.1111)
-->
<SemanticVersionDate>2020-09-08</SemanticVersionDate>
<SemanticVersionDate>2020-12-01</SemanticVersionDate>

<!--
Pre-release version is used to distinguish internally built NuGet packages.
Pre-release version = Minutes since semantic version was set, divided by 5 (to make it fit in a UInt16 (max 65535 = ~7 months).
BuildNumber uniquely identifies all builds (The max allowed value is UInt16.MaxValue = 65535).
The BuildNumber is used for nightly build package name and DLL assembly version.
NuGet uses alphanumeric sorting, so this value is padded with zeros.
BuildNumber = Hours since semantic version was set, divided by 12 (~89 years).
-->
<BuildNumber>$([MSBuild]::Divide($([System.DateTime]::Now.Subtract($([System.DateTime]::Parse($(SemanticVersionDate)))).TotalMinutes), 5).ToString('F0'))</BuildNumber>
<BuildNumberHours>$([MSBuild]::Divide($([System.DateTime]::Now.Subtract($([System.DateTime]::Parse($(SemanticVersionDate)))).TotalHours), 12))</BuildNumberHours>
<BuildNumber>$([System.Math]::Floor($(BuildNumberHours)).ToString('F0').PadLeft(5, '0'))</BuildNumber>

<VersionPrefix>$(SemanticVersionMajor).$(SemanticVersionMinor).$(SemanticVersionPatch)</VersionPrefix>
<VersionSuffix>$(PreReleaseMilestone)</VersionSuffix>
Expand Down
2 changes: 1 addition & 1 deletion .scripts/release_NupkgAudit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ function Get-DoesDllVersionsMatch ([string]$dllPath) {

$message = "File Version: '$fileVersion' Assembly Version: '$assemblyVersion";
$requirement = "Versions should match."
Test-Condition ($fileVersion.Equals($assemblyVersion)) $message $requirement;
Test-Condition ([version]$fileVersion -eq [version]$assemblyVersion) $message $requirement;
}

function Get-IsValidPackageId([xml]$nuspecXml) {
Expand Down