-
-
Notifications
You must be signed in to change notification settings - Fork 339
/
Copy pathbuild-avalonia.ps1
46 lines (40 loc) · 1.03 KB
/
build-avalonia.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
param(
[string] $ReleasePath = ".\release",
[string] $VersionPrefix = "5.0.0",
[string] $VersionSuffix = $null
)
$publishPath = "publish\avalonia"
$platforms = $(
# linux builds
"linux-arm64",
"linux-musl-x64",
"linux-x64",
"linux-musl-arm64",
# windows
"win-x64",
"win-arm64",
# mac
"osx-x64",
"osx-arm64"
)
if (Test-Path -Path ".\$publishPath") { Remove-Item -Path ".\$publishPath" -Force -Recurse }
$platforms | ForEach-Object {
$buildArgs = @(
"publish"
"-c"
"Release"
"-r"
$_
"--self-contained"
"true"
"-p:PublishSingleFile=true"
"-o"
".\$publishPath\$_"
"/p:VersionPrefix=""$VersionPrefix"""
"--version-suffix"
"$VersionSuffix"
".\src\TEdit5\TEdit5.csproj"
)
& dotnet $buildArgs
Compress-Archive -Path ".\$publishPath\$_\*" -DestinationPath ".\$ReleasePath\TEditAvalonia-$VersionPrefix-$VersionSuffix-$_.zip"
}