1- echo " build: Build started"
1+ Write-Output " build: Build started"
22
33Push-Location $PSScriptRoot
44
55if (Test-Path .\artifacts) {
6- echo " build: Cleaning .\artifacts"
7- Remove-Item .\artifacts - Force - Recurse
6+ Write-Output " build: Cleaning .\artifacts"
7+ Remove-Item .\artifacts - Force - Recurse
88}
99
1010$branch = @ { $true = $env: APPVEYOR_REPO_BRANCH ; $false = $ (git symbolic- ref -- short - q HEAD) }[$env: APPVEYOR_REPO_BRANCH -ne $NULL ];
@@ -13,20 +13,20 @@ $suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch
1313$commitHash = $ (git rev- parse -- short HEAD)
1414$buildSuffix = @ { $true = " $ ( $suffix ) -$ ( $commitHash ) " ; $false = " $ ( $branch ) -$ ( $commitHash ) " }[$suffix -ne " " ]
1515
16- echo " build: Package version suffix is $suffix "
17- echo " build: Build version suffix is $buildSuffix "
16+ Write-Output " build: Package version suffix is $suffix "
17+ Write-Output " build: Build version suffix is $buildSuffix "
1818
1919& dotnet build -- configuration Release -- version- suffix= $buildSuffix / p:ContinuousIntegrationBuild= true
2020
21- if ($LASTEXITCODE -ne 0 ) { exit 1 }
21+ if ($LASTEXITCODE -ne 0 ) { throw ' build failed ' }
2222
2323if ($suffix ) {
2424 & dotnet pack src\Serilog.Settings.Configuration -- configuration Release -- no- build -- no- restore - o artifacts -- version- suffix= $suffix
2525} else {
2626 & dotnet pack src\Serilog.Settings.Configuration -- configuration Release -- no- build -- no- restore - o artifacts
2727}
2828
29- if ($LASTEXITCODE -ne 0 ) { exit 2 }
29+ if ($LASTEXITCODE -ne 0 ) { throw ' pack failed ' }
3030
3131Write-Output " build: Testing"
3232
@@ -35,4 +35,4 @@ Write-Output "build: Testing"
3535# The _reported_ runtime is wrong but the _actual_ used runtime is correct, see https://github.com/microsoft/vstest/issues/2037#issuecomment-720549173
3636& dotnet test test\Serilog.Settings.Configuration.Tests\bin\Release\* \Serilog.Settings.Configuration.Tests.dll -- parallel
3737
38- if ($LASTEXITCODE -ne 0 ) { exit 3 }
38+ if ($LASTEXITCODE -ne 0 ) { throw ' unit tests failed ' }
0 commit comments