-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget-releases.ps1
More file actions
66 lines (63 loc) · 1.88 KB
/
get-releases.ps1
File metadata and controls
66 lines (63 loc) · 1.88 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
function Build(){
param(
[bool] $NativeAOT,
[string] $Runtime = $null,
[bool] $SelfContained
)
$name = "JanD"
$cmd = "dotnet publish JanD -c release"
if($Runtime -ne $null){
$cmd += " -r $Runtime"
$name += "-$Runtime"
}
if($NativeAOT){
$name += "-nativeaot"
}
if($NativeAOT -eq $false){
$cmd += " -p:NoNativeAOTPublish=no"
}
if($NativeAOT -eq $false -and $SelfContained -eq $true){
$cmd += " -p:PublishSingleFile=true --self-contained -p:PublishTrimmed=true";
$name += "-contained"
}
if($NativeAOT -eq $false -and $SelfContained -eq $false){
$cmd += " -p:PublishSingleFile=true --no-self-contained -p:PublishTrimmed=false";
$name += "-fxdependent"
}
$cmd += " -o JanD/bin/release/$name"
Write-Output "$($name): $cmd"
Invoke-Expression $cmd
}
function BuildsFor(){
param(
[string]$Runtime
)
Build -NativeAot $false -Runtime $Runtime -SelfContained $false
Build -NativeAot $false -Runtime $Runtime -SelfContained $true
}
Remove-Item -Force -Recurse ./JanD/bin/release
Remove-Item -Force -Recurse ./JanD/bin/release-exec
BuildsFor win-x64
BuildsFor linux-x64
BuildsFor linux-musl-x64
BuildsFor linux-arm
BuildsFor linux-arm64
BuildsFor osx-x64
BuildsFor osx-arm64
mkdir ./JanD/bin/release-exec
foreach($dir in (ls ./JanD/bin/release)){
if($dir.Name.StartsWith("JanD-")){
echo $dir
if($dir.Name.Contains("-osx-") -or $dir.Name.Contains("-linux-")){
# osx and linux
mv "$($dir.FullName)/JanD" "./JanD/bin/release-exec/$($dir.Name)"
if($dir.Name.Contains("-contained")){
gzip "./JanD/bin/release-exec/$($dir.Name)"
}
}
else{
# windows
mv "$($dir.FullName)/JanD.exe" "./JanD/bin/release-exec/$($dir.Name).exe"
}
}
}