Change the build number to 'major.minor.build.revision'.
This is required for the Windows MSI ProductVersion to support major/minor upgrades. https://msdn.microsoft.com/en-us/library/aa370859(v=vs.85).aspx
This commit is contained in:
parent
fb61e69a79
commit
6a0a982f2f
1 changed files with 7 additions and 4 deletions
|
@ -21,11 +21,14 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR\cli\bin;$env:PATH"
|
|||
if (!$env:DOTNET_BUILD_VERSION) {
|
||||
# Get the timestamp of the most recent commit
|
||||
$timestamp = git log -1 --format=%ct
|
||||
$origin = New-Object -Type DateTime -ArgumentList 1970, 1, 1, 0, 0, 0, 0
|
||||
$commitTime = $origin.AddSeconds($timestamp)
|
||||
$LastCommitTimestamp = $commitTime.ToString("yyyyMMdd-HHmmss")
|
||||
$commitTime = [timespan]::FromSeconds($timestamp)
|
||||
|
||||
$env:DOTNET_BUILD_VERSION = "0.0.1-alpha-$LastCommitTimestamp"
|
||||
$majorVersion = 1
|
||||
$minorVersion = 0
|
||||
$buildnumber = $commitTime.Days
|
||||
$revnumber = $commitTime.TotalSeconds
|
||||
|
||||
$env:DOTNET_BUILD_VERSION = "$majorVersion.$minorVersion.$buildnumber.$revnumber"
|
||||
}
|
||||
|
||||
Write-Host -ForegroundColor Green "*** Building dotnet tools version $($env:DOTNET_BUILD_VERSION) - $Configuration ***"
|
||||
|
|
Loading…
Add table
Reference in a new issue