Skip to content

Commit

Permalink
fix(appveyor): dev package number misses original version number
Browse files Browse the repository at this point in the history
  • Loading branch information
GiuseppePiscopo committed Mar 28, 2017
1 parent 0ca6d49 commit 834429d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions sln/Build-Package.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ function GetVersionOptions([string]$nuSpecPath) {
Write-Host "Continuous Delivery, Production package, keeping nupkg version as is."
$versionOpts = @()
} else {
# this should have already been updated to development full version number (<vers nr>-dev-<build nr>)
$devVersionNumber = $env:APPVEYOR_BUILD_NUMBER
# this should have already been updated to development version number (<nuspec vers>-dev-<build nr>)
$devPackageVersion = $env:APPVEYOR_BUILD_VERSION

Write-Host "Continuous Delivery, Development package, changing nupkg version to '$devVersionNumber'."
Write-Host "Continuous Delivery, Development package, changing nupkg version to '$devPackageVersion'."

$versionOpts = @( "-version", $devVersionNumber )
$versionOpts = @( "-version", $devPackageVersion )
}
} else {
Write-Host "Local machine, keeping nupkg version as is."
Expand All @@ -69,7 +69,7 @@ function GetVersionOptions([string]$nuSpecPath) {
# Main

# move to global.json directory
cd sln
Push-Location sln

# Clean
@(
Expand Down Expand Up @@ -119,4 +119,4 @@ Exec {
-properties Configuration=Release
}

cd ..
Pop-Location
12 changes: 6 additions & 6 deletions sln/Set-BuildNumber.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ function GetNuSpecVersion([string]$path) {

# Main

cd sln
Push-Location sln

# override AppVeyor build number, trying to avoid collisions
# override AppVeyor build version, trying to avoid collisions

$nuSpecPath = "src\NSpec\NSpec.nuspec"

$buildNumber = $env:APPVEYOR_BUILD_NUMBER
$suffix = "dev-$buildNumber"

$nuSpecVersion = GetNuSpecVersion $nuSpecPath
$uniqueBuildNumber = "$nuSpecVersion-$suffix"
$uniqueBuildVersion = "$nuSpecVersion-$suffix"

Write-Host "Changing build number to '$uniqueBuildNumber'..."
Write-Host "Changing build version to '$uniqueBuildVersion'..."

Update-AppveyorBuild -Version $uniqueBuildNumber
Update-AppveyorBuild -Version $uniqueBuildVersion

cd ..
Pop-Location

0 comments on commit 834429d

Please sign in to comment.