Skip to content

Commit

Permalink
Tune appveyor.yml to push to prod feed only for release or rc tags
Browse files Browse the repository at this point in the history
  • Loading branch information
zvirja committed Apr 10, 2017
1 parent 640e1e6 commit aaa19ea
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,43 @@ build_script:
if($isTagBuild)
{
Write-Host "Trigger tag build & push to all feeds" -ForegroundColor Green
& .\build.cmd PublishNuGetAll NuGetPreReleaseKey="$($Env:MYGET_API_KEY)" NuGetReleaseKey="$($Env:NUGET_API_KEY)"
$tagName = $Env:APPVEYOR_REPO_TAG_NAME
# Check if this is release tag or RC
$publishToProd = $tagName -match '^v(\d+)(\.\d+)+(-rc[\d\.]+)?$'
$isSemVerTag = $tagName -match '^v.*'
if($publishToProd)
{
Write-Host "Trigger tag build & push to all feeds. Tag name: $tagName" -ForegroundColor Green
& .\build.cmd PublishNuGetAll NuGetPreReleaseKey="$($Env:MYGET_API_KEY)" NuGetReleaseKey="$($Env:NUGET_API_KEY)" Version=git
}
elseif ($isSemVerTag)
{
Write-Host "Trigger tag build & push to pre-prod feed only. Tag name: $tagName" -ForegroundColor Green
& .\build.cmd PublishNuGetPreRelease NuGetPreReleaseKey="$($Env:MYGET_API_KEY)" Version=git
}
else
{
Write-Host "Trigger tag build only - this is not a SemVer tag. Tag name: $tagName" -ForegroundColor Green
& .\build.cmd CompleteBuild Version=git
}
}
#Should be checked _before_ branch name, because branch name is set to "base" branch for Pull Requests
elseif($isPullRequest -eq $true)
{
Write-Host "Trigger PR verification build" -ForegroundColor Green
& .\build.cmd CompleteBuild
& .\build.cmd CompleteBuild Version=git
}
elseif(($branchName -eq "master_playground") -or ($branchName -eq "v4"))
{
Write-Host "Trigger full build & push to pre-release feed" -ForegroundColor Green
& .\build.cmd PublishNuGetPreRelease NuGetPreReleaseKey="$($Env:MYGET_API_KEY)"
& .\build.cmd PublishNuGetPreRelease NuGetPreReleaseKey="$($Env:MYGET_API_KEY)" Version=git
}
else
{
# If this is a custom branch - just build the code without publishing the artifacts somewhere.
Write-Host "Trigger build for a custom branch" -ForegroundColor Green
& .\build.cmd CompleteBuild
& .\build.cmd CompleteBuild Version=git
}
test_script:
Expand Down

0 comments on commit aaa19ea

Please sign in to comment.