Skip to content

Commit

Permalink
Fix Appveyor failing to set preview version after releasing additiona…
Browse files Browse the repository at this point in the history
…l build version
  • Loading branch information
lordmilko committed Feb 19, 2020
1 parent 5e0b08e commit 4e2c629
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
7 changes: 6 additions & 1 deletion build/CI/Appveyor/Set-AppveyorVersion.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ function IncrementBuild($version)

function IsPreview($assemblyVersion, $lastRelease)
{
if([string]::IsNullOrEmpty($lastRelease))
{
return $false
}

# If this DLL has the same version as the last RELEASE, this should be a preview release
return $assemblyVersion -eq $lastRelease
return $assemblyVersion -eq (CleanVersion $lastRelease)
}

function IsFirstPreview($lastBuild)
Expand Down
11 changes: 11 additions & 0 deletions build/CI/Tests/Appveyor.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,17 @@ Describe "Appveyor" {
Simulate-Build @buildArgs
}

It "Release 0.1 (u1) -> Commit (p1) = 0.1.1-preview.1" {
$buildArgs = @{
Assembly = "0.1.0"
LastBuild = "0.1.0-build.1"
LastRelease = "0.1.0-build.1"
Expected = "0.1.1-preview.1"
}

Simulate-Build @buildArgs
}

It "First Build" {
$buildArgs = @{
Assembly = "0.1.0"
Expand Down

0 comments on commit 4e2c629

Please sign in to comment.