forked from TurnerSoftware/CacheTower
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.appveyor.ps1
35 lines (28 loc) · 964 Bytes
/
build.appveyor.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Write-Host "Initialising AppVeyor build..." -ForegroundColor "Magenta"
$baseBuildVersion = git describe --tags --abbrev=0
if ($baseBuildVersion -contains "fatal") {
$baseBuildVersion = "0.0.0"
}
$isTagBuild = $False
$buildMetadata = "$($env:APPVEYOR_REPO_COMMIT.substring(0,7))-$($env:APPVEYOR_BUILD_NUMBER)"
$prereleaseVersion = "dev"
if ($env:APPVEYOR_REPO_TAG -ne "false") {
$baseBuildVersion = $env:APPVEYOR_REPO_TAG_NAME
$prereleaseVersion = $False
$isTagBuild = $True
}
elseif ($env:APPVEYOR_PULL_REQUEST_NUMBER) {
$prereleaseVersion = "PR$($env:APPVEYOR_PULL_REQUEST_NUMBER)"
}
$buildVersion = "$baseBuildVersion+$buildMetadata"
if ($prereleaseVersion) {
$buildVersion = "$baseBuildVersion-$prereleaseVersion+$buildMetadata"
}
Update-AppveyorBuild -Version $buildVersion
if ($isTagBuild) {
.\build.ps1 -CreatePackages $True -BuildVersion $buildVersion
}
else {
.\build.ps1 -CheckCoverage $True -BuildVersion $buildVersion
}
Exit $LastExitCode