|
1 | 1 | # Usage: Release.ps1 -version <version>
|
2 | 2 | param (
|
3 |
| - [Parameter(Mandatory = $true)] |
4 |
| - [ValidatePattern("^\d+\.\d+\.\d+$")] |
5 |
| - [string] $version, |
| 3 | + [Parameter(Mandatory = $true)] |
| 4 | + [ValidatePattern("^\d+\.\d+\.\d+$")] |
| 5 | + [string] $version, |
6 | 6 |
|
7 |
| - [Parameter(Mandatory = $true)] |
8 |
| - [ValidatePattern("^\d+\.\d+\.\d+\.\d+$")] |
9 |
| - [string] $assemblyVersion |
| 7 | + [Parameter(Mandatory = $true)] |
| 8 | + [ValidatePattern("^\d+\.\d+\.\d+\.\d+$")] |
| 9 | + [string] $assemblyVersion |
10 | 10 | )
|
11 | 11 |
|
12 | 12 | $ErrorActionPreference = "Stop"
|
13 | 13 |
|
14 | 14 | foreach ($arch in @("x64", "arm64")) {
|
15 |
| - Write-Host "::group::Publishing $arch" |
16 |
| - try { |
17 |
| - $archUpper = $arch.ToUpper() |
| 15 | + Write-Host "::group::Publishing $arch" |
| 16 | + try { |
| 17 | + $archUpper = $arch.ToUpper() |
18 | 18 |
|
19 |
| - $msiOutputPath = "publish/CoderDesktopCore-$version-$arch.msi" |
20 |
| - Add-Content -Path $env:GITHUB_OUTPUT -Value "$($archUpper)_MSI_OUTPUT_PATH=$msiOutputPath" |
21 |
| - Write-Host "MSI_OUTPUT_PATH=$msiOutputPath" |
| 19 | + $msiOutputPath = "publish/CoderDesktopCore-$version-$arch.msi" |
| 20 | + Add-Content -Path $env:GITHUB_OUTPUT -Value "$($archUpper)_MSI_OUTPUT_PATH=$msiOutputPath" |
| 21 | + Write-Host "MSI_OUTPUT_PATH=$msiOutputPath" |
22 | 22 |
|
23 |
| - $outputPath = "publish/CoderDesktop-$version-$arch.exe" |
24 |
| - Add-Content -Path $env:GITHUB_OUTPUT -Value "$($archUpper)_OUTPUT_PATH=$outputPath" |
25 |
| - Write-Host "OUTPUT_PATH=$outputPath" |
| 23 | + $outputPath = "publish/CoderDesktop-$version-$arch.exe" |
| 24 | + Add-Content -Path $env:GITHUB_OUTPUT -Value "$($archUpper)_OUTPUT_PATH=$outputPath" |
| 25 | + Write-Host "OUTPUT_PATH=$outputPath" |
26 | 26 |
|
27 |
| - $publishScript = Join-Path $PSScriptRoot "Publish.ps1" |
28 |
| - & $publishScript ` |
29 |
| - -version $assemblyVersion ` |
30 |
| - -arch $arch ` |
31 |
| - -msiOutputPath $msiOutputPath ` |
32 |
| - -outputPath $outputPath ` |
33 |
| - -sign |
34 |
| - if ($LASTEXITCODE -ne 0) { throw "Failed to publish" } |
| 27 | + $publishScript = Join-Path $PSScriptRoot "Publish.ps1" |
| 28 | + & $publishScript ` |
| 29 | + -version $assemblyVersion ` |
| 30 | + -arch $arch ` |
| 31 | + -msiOutputPath $msiOutputPath ` |
| 32 | + -outputPath $outputPath ` |
| 33 | + -sign |
| 34 | + if ($LASTEXITCODE -ne 0) { throw "Failed to publish" } |
35 | 35 |
|
36 |
| - # Verify that the output exe is authenticode signed |
37 |
| - $sig = Get-AuthenticodeSignature $outputPath |
38 |
| - if ($sig.Status -ne "Valid") { |
39 |
| - throw "Output file is not authenticode signed" |
| 36 | + # Verify that the output exe is authenticode signed |
| 37 | + $sig = Get-AuthenticodeSignature $outputPath |
| 38 | + if ($sig.Status -ne "Valid") { |
| 39 | + throw "Output file is not authenticode signed" |
| 40 | + } |
| 41 | + else { |
| 42 | + Write-Host "Output file is authenticode signed" |
| 43 | + } |
40 | 44 | }
|
41 |
| - else { |
42 |
| - Write-Host "Output file is authenticode signed" |
| 45 | + finally { |
| 46 | + Write-Host "::endgroup::" |
43 | 47 | }
|
44 |
| - } |
45 |
| - finally { |
46 |
| - Write-Host "::endgroup::" |
47 |
| - } |
48 | 48 | }
|
0 commit comments