1
- echo " build: Build started"
1
+ Write-Output " build: Build started"
2
2
3
3
Push-Location $PSScriptRoot
4
4
5
5
if (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
8
8
}
9
9
10
10
$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
13
13
$commitHash = $ (git rev- parse -- short HEAD)
14
14
$buildSuffix = @ { $true = " $ ( $suffix ) -$ ( $commitHash ) " ; $false = " $ ( $branch ) -$ ( $commitHash ) " }[$suffix -ne " " ]
15
15
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 "
18
18
19
19
& dotnet build -- configuration Release -- version- suffix= $buildSuffix / p:ContinuousIntegrationBuild= true
20
20
21
- if ($LASTEXITCODE -ne 0 ) { exit 1 }
21
+ if ($LASTEXITCODE -ne 0 ) { throw ' build failed ' }
22
22
23
23
if ($suffix ) {
24
24
& dotnet pack src\Serilog.Settings.Configuration -- configuration Release -- no- build -- no- restore - o artifacts -- version- suffix= $suffix
25
25
} else {
26
26
& dotnet pack src\Serilog.Settings.Configuration -- configuration Release -- no- build -- no- restore - o artifacts
27
27
}
28
28
29
- if ($LASTEXITCODE -ne 0 ) { exit 2 }
29
+ if ($LASTEXITCODE -ne 0 ) { throw ' pack failed ' }
30
30
31
31
Write-Output " build: Testing"
32
32
@@ -35,4 +35,4 @@ Write-Output "build: Testing"
35
35
# The _reported_ runtime is wrong but the _actual_ used runtime is correct, see https://github.com/microsoft/vstest/issues/2037#issuecomment-720549173
36
36
& dotnet test test\Serilog.Settings.Configuration.Tests\bin\Release\* \Serilog.Settings.Configuration.Tests.dll -- parallel
37
37
38
- if ($LASTEXITCODE -ne 0 ) { exit 3 }
38
+ if ($LASTEXITCODE -ne 0 ) { throw ' unit tests failed ' }
0 commit comments