-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRelease.ps1
48 lines (41 loc) · 1.5 KB
/
Release.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
47
48
# Usage: Release.ps1 -version <version>
param (
[Parameter(Mandatory = $true)]
[ValidatePattern("^\d+\.\d+\.\d+$")]
[string] $version,
[Parameter(Mandatory = $true)]
[ValidatePattern("^\d+\.\d+\.\d+\.\d+$")]
[string] $assemblyVersion
)
$ErrorActionPreference = "Stop"
foreach ($arch in @("x64", "arm64")) {
Write-Host "::group::Publishing $arch"
try {
$archUpper = $arch.ToUpper()
$msiOutputPath = "publish/CoderDesktopCore-$version-$arch.msi"
Add-Content -Path $env:GITHUB_OUTPUT -Value "$($archUpper)_MSI_OUTPUT_PATH=$msiOutputPath"
Write-Host "MSI_OUTPUT_PATH=$msiOutputPath"
$outputPath = "publish/CoderDesktop-$version-$arch.exe"
Add-Content -Path $env:GITHUB_OUTPUT -Value "$($archUpper)_OUTPUT_PATH=$outputPath"
Write-Host "OUTPUT_PATH=$outputPath"
$publishScript = Join-Path $PSScriptRoot "Publish.ps1"
& $publishScript `
-version $assemblyVersion `
-arch $arch `
-msiOutputPath $msiOutputPath `
-outputPath $outputPath `
-sign
if ($LASTEXITCODE -ne 0) { throw "Failed to publish" }
# Verify that the output exe is authenticode signed
$sig = Get-AuthenticodeSignature $outputPath
if ($sig.Status -ne "Valid") {
throw "Output file is not authenticode signed"
}
else {
Write-Host "Output file is authenticode signed"
}
}
finally {
Write-Host "::endgroup::"
}
}