-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Expand file tree
/
Copy pathpublish.ps1
More file actions
49 lines (45 loc) · 2.85 KB
/
Copy pathpublish.ps1
File metadata and controls
49 lines (45 loc) · 2.85 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
#!/usr/bin/env pwsh
# Publish the per-platform distribution bundles. Invoked by the build workflow as:
# ./publish.ps1 -Configuration <Debug|Release> -Platform <windows|linux|macos>
# windows: win-x64 framework-dependent bundle for every configuration (the binaries zip);
# the win-arm64 framework-dependent and win-x64 self-contained bundles are Release-only.
# linux: linux-x64 self-contained bundle.
# macos: osx-arm64 self-contained bundle; the BuildMacAppBundle target in ILSpy.csproj
# assembles ILSpy.app next to the publish directory.
param(
[ValidateSet('Debug', 'Release')]
[string]$Configuration = 'Release',
[ValidateSet('windows', 'linux', 'macos')]
[string]$Platform = 'windows'
)
$ErrorActionPreference = 'Stop'
$env:OPENSSL_ENABLE_SHA1_SIGNATURES = '1'
$base = "./ILSpy/bin/$Configuration/net10.0"
switch ($Platform) {
'windows' {
$output_x64 = "$base/win-x64/publish/fwdependent"
dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --no-self-contained -r win-x64 -o $output_x64
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --no-self-contained -r win-x64 -o $output_x64
if ($Configuration -eq 'Release') {
$output_arm64 = "$base/win-arm64/publish/fwdependent"
dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --no-self-contained -r win-arm64 -o $output_arm64
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --no-self-contained -r win-arm64 -o $output_arm64
$output_x64_selfcontained = "$base/win-x64/publish/selfcontained"
dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --self-contained -r win-x64 -o $output_x64_selfcontained
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --self-contained -r win-x64 -o $output_x64_selfcontained
}
}
'linux' {
$output = "$base/linux-x64/publish/selfcontained"
dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --self-contained -r linux-x64 -o $output
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --self-contained -r linux-x64 -o $output
}
'macos' {
$output = "$base/osx-arm64/publish/selfcontained"
# The ReadyToRun plugin must be published first: BuildMacAppBundle runs after the
# ILSpy publish and snapshots the publish directory into ILSpy.app/Contents/MacOS,
# so everything that belongs in the bundle has to be in place by then.
dotnet publish ./ILSpy.ReadyToRun/ILSpy.ReadyToRun.csproj -c $Configuration --no-restore --self-contained -r osx-arm64 -o $output
dotnet publish ./ILSpy/ILSpy.csproj -c $Configuration --no-restore --self-contained -r osx-arm64 -o $output
}
}