-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.ps1
29 lines (22 loc) · 899 Bytes
/
build.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
$ErrorActionPreference = 'Stop'
# Options
$configuration = 'Release'
$artifactsDir = Join-Path (Resolve-Path .) 'artifacts'
$binDir = Join-Path $artifactsDir 'Bin'
$testResultsDir = Join-Path $artifactsDir 'Test results'
$logsDir = Join-Path $artifactsDir 'Logs'
$dotnetArgs = @(
'--configuration', $configuration
'/p:ContinuousIntegrationBuild=' + ($env:CI -or $env:TF_BUILD)
)
# Build
dotnet build /bl:$logsDir\build.binlog @dotnetArgs
if ($LastExitCode) { exit 1 }
# Pack
Remove-Item -Recurse -Force $binDir -ErrorAction Ignore
dotnet publish Sideways --no-build --output $binDir /bl:$logsDir\publish.binlog @dotnetArgs
if ($LastExitCode) { exit 1 }
# Test
Remove-Item -Recurse -Force $testResultsDir -ErrorAction Ignore
dotnet test --no-build --configuration $configuration --logger trx --results-directory $testResultsDir /bl:"$logsDir\test.binlog"
if ($LastExitCode) { exit 1 }