Skip to content

Commit 325c3c9

Browse files
authored
Merge pull request #225 from datalust/dev
2021.4 Maintenance Release
2 parents 02bde41 + 22c1468 commit 325c3c9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

Build.ps1

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ function Clean-Output
1111
function Restore-Packages
1212
{
1313
& dotnet restore
14+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
1415
}
1516

1617
function Execute-Tests
1718
{
1819
& dotnet test ./test/SeqCli.Tests/SeqCli.Tests.csproj -c Release /p:Configuration=Release /p:Platform=x64 /p:VersionPrefix=$version
19-
if($LASTEXITCODE -ne 0) { exit 3 }
20+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
2021
}
2122

2223
function Create-ArtifactDir
@@ -34,23 +35,23 @@ function Publish-Archives($version)
3435
}
3536

3637
& dotnet publish ./src/SeqCli/SeqCli.csproj -c Release -f $tfm -r $rid /p:VersionPrefix=$version
37-
if($LASTEXITCODE -ne 0) { exit 4 }
38+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
3839

3940
# Make sure the archive contains a reasonable root filename
4041
mv ./src/SeqCli/bin/Release/$tfm/$rid/publish/ ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/
4142

4243
if ($rid.StartsWith("win-")) {
4344
& ./build/7-zip/7za.exe a -tzip ./artifacts/seqcli-$version-$rid.zip ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/
44-
if($LASTEXITCODE -ne 0) { exit 5 }
45+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
4546
} else {
4647
& ./build/7-zip/7za.exe a -ttar seqcli-$version-$rid.tar ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/
47-
if($LASTEXITCODE -ne 0) { exit 5 }
48+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
4849

4950
# Back to the original directory name
5051
mv ./src/SeqCli/bin/Release/$tfm/$rid/seqcli-$version-$rid/ ./src/SeqCli/bin/Release/$tfm/$rid/publish/
5152

5253
& ./build/7-zip/7za.exe a -tgzip ./artifacts/seqcli-$version-$rid.tar.gz seqcli-$version-$rid.tar
53-
if($LASTEXITCODE -ne 0) { exit 6 }
54+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
5455

5556
rm seqcli-$version-$rid.tar
5657
}
@@ -60,23 +61,25 @@ function Publish-Archives($version)
6061
function Publish-DotNetTool($version)
6162
{
6263
# Tool packages have to target a single non-platform-specific TFM; doing this here is cleaner than attempting it in the CSPROJ directly
63-
dotnet pack ./src/SeqCli/SeqCli.csproj -c Release --output ./artifacts /p:VersionPrefix=$version /p:TargetFramework=$framework /p:TargetFrameworks=
64-
if($LASTEXITCODE -ne 0) { exit 7 }
64+
dotnet pack ./src/SeqCli/SeqCli.csproj -c Release --output ./artifacts /p:VersionPrefix=$version /p:TargetFrameworks=$framework
65+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
6566
}
6667

6768
function Publish-Docs($version)
6869
{
6970
Write-Output "Generating markdown documentation"
7071

7172
& dotnet run --project ./src/SeqCli/SeqCli.csproj -f $framework -- help --markdown > ./artifacts/seqcli-$version.md
72-
if($LASTEXITCODE -ne 0) { exit 8 }
73+
if($LASTEXITCODE -ne 0) { throw "Build failed" }
7374
}
7475

7576
Push-Location $PSScriptRoot
7677

7778
$version = @{ $true = $env:APPVEYOR_BUILD_VERSION; $false = "99.99.99" }[$env:APPVEYOR_BUILD_VERSION -ne $NULL];
7879
Write-Output "Building version $version"
7980

81+
$env:Path = "$pwd/.dotnetcli;$env:Path"
82+
8083
Clean-Output
8184
Create-ArtifactDir
8285
Restore-Packages

0 commit comments

Comments
 (0)