-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathBuild.ps1
More file actions
33 lines (25 loc) · 1.09 KB
/
Build.ps1
File metadata and controls
33 lines (25 loc) · 1.09 KB
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
# This script originally (c) 2016 Serilog Contributors - license Apache 2.0
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL];
$revision = @{ $true = ""; $false = "-local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL];
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))$revision"}[$branch -eq "main" -and $revision -ne "local"]
$version = "1.0."
if ($env:APPVEYOR_BUILD_NUMBER -ne $NULL) {
$version = $version + $env:APPVEYOR_BUILD_NUMBER
} else {
$version = $version + "0"
}
if ($suffix) {
$version = $version + "-" + $suffix
}
if (Test-Path .\publish) {
Remove-Item .\publish -Recurse
}
mkdir .\publish
cargo build --release --target=x86_64-unknown-linux-musl
if ($LASTEXITCODE) { exit 1 }
cargo build --release --target=aarch64-unknown-linux-musl
if ($LASTEXITCODE) { exit 1 }
cargo build --release --target=x86_64-pc-windows-msvc
if ($LASTEXITCODE) { exit 1 }
& .\tool\nuget.exe pack .\Seq.App.JsonArchive.nuspec -version $version -outputdirectory .\publish
exit $LASTEXITCODE