mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Make sure GA revision increases from RC and Preview releases (#15558)
This commit is contained in:
@@ -49,13 +49,15 @@
|
||||
<ReleaseTagSemVersionPrereleaseNamePart>$([System.Text.RegularExpressions.Regex]::Match($(ReleaseTag), $(RegexReleaseTag)).Groups[6].Value)</ReleaseTagSemVersionPrereleaseNamePart>
|
||||
<!-- Increment revision 100 for rc releases -->
|
||||
<RCIncrementValue>100</RCIncrementValue>
|
||||
<!-- Increment revision 500 for GA releases -->
|
||||
<GAIncrementValue>500</GAIncrementValue>
|
||||
<ReleaseTagSemVersionPart Condition = "'$(ReleaseTagSemVersionPrereleaseNamePart)' == 'rc'">$([MSBuild]::Add($(ReleaseTagSemVersionPart), $(RCIncrementValue)))</ReleaseTagSemVersionPart>
|
||||
<!-- Create the internal version -->
|
||||
<PSCoreBuildVersion>$(ReleaseTag)</PSCoreBuildVersion>
|
||||
<!-- Create the version if we have a pre-release -->
|
||||
<PSCoreFileVersion Condition = "'$(ReleaseTagSemVersionPart)' != ''">$(ReleaseTagVersionPart).$(ReleaseTagSemVersionPart)</PSCoreFileVersion>
|
||||
<!-- Create the version if we have a release build -->
|
||||
<PSCoreFileVersion Condition = "'$(PSCoreFileVersion)' == ''">$(ReleaseTagVersionPart)</PSCoreFileVersion>
|
||||
<PSCoreFileVersion Condition = "'$(PSCoreFileVersion)' == ''">$(ReleaseTagVersionPart).$(GAIncrementValue)</PSCoreFileVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -85,17 +85,28 @@ Describe -Name "Windows MSI" -Fixture {
|
||||
Context "Upgrade code" {
|
||||
BeforeAll {
|
||||
Write-Verbose "cr-$channel-$runtime" -Verbose
|
||||
$pwshPath = Join-Path $env:ProgramFiles -ChildPath "PowerShell"
|
||||
$pwshx86Path = Join-Path ${env:ProgramFiles(x86)} -ChildPath "PowerShell"
|
||||
|
||||
switch ("$channel-$runtime") {
|
||||
"preview-win7-x64" {
|
||||
$versionPath = Join-Path -Path $pwshPath -ChildPath '7-preview'
|
||||
$revisionRange = 0, 99
|
||||
$msiUpgradeCode = '39243d76-adaf-42b1-94fb-16ecf83237c8'
|
||||
}
|
||||
"stable-win7-x64" {
|
||||
$versionPath = Join-Path -Path $pwshPath -ChildPath '7'
|
||||
$revisionRange = 500, 500
|
||||
$msiUpgradeCode = '31ab5147-9a97-4452-8443-d9709f0516e1'
|
||||
}
|
||||
"preview-win7-x86" {
|
||||
$versionPath = Join-Path -Path $pwshx86Path -ChildPath '7-preview'
|
||||
$revisionRange = 0, 99
|
||||
$msiUpgradeCode = '86abcfbd-1ccc-4a88-b8b2-0facfde29094'
|
||||
}
|
||||
"stable-win7-x86" {
|
||||
$versionPath = Join-Path -Path $pwshx86Path -ChildPath '7'
|
||||
$revisionRange = 500, 500
|
||||
$msiUpgradeCode = '1d00683b-0f84-4db8-a64f-2f98ad42fe06'
|
||||
}
|
||||
default {
|
||||
@@ -120,6 +131,14 @@ Describe -Name "Windows MSI" -Fixture {
|
||||
$result.Count | Should -Be 1 -Because "Query should return 1 result if Upgrade code is for $runtime $channel"
|
||||
}
|
||||
|
||||
It "Revision should be in correct range" -Skip:(!(Test-Elevated)) {
|
||||
$pwshDllPath = Join-Path -Path $versionPath -ChildPath "pwsh.dll"
|
||||
[version] $version = (Get-ChildItem $pwshDllPath).VersionInfo.FileVersion
|
||||
Write-Verbose "pwsh.dll version: $version" -Verbose
|
||||
$version.Revision | Should -BeGreaterOrEqual $revisionRange[0] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])"
|
||||
$version.Revision | Should -BeLessOrEqual $revisionRange[1] -Because "$channel revision should between $($revisionRange[0]) and $($revisionRange[1])"
|
||||
}
|
||||
|
||||
It "MSI should uninstall without error" -Skip:(!(Test-Elevated)) {
|
||||
{
|
||||
Invoke-MsiExec -Uninstall -MsiPath $msiX64Path
|
||||
|
||||
Reference in New Issue
Block a user