Skip to content

Commit 12d1973

Browse files
committed
check sig
1 parent 292c9e5 commit 12d1973

File tree

2 files changed

+39
-33
lines changed

2 files changed

+39
-33
lines changed

scripts/Publish.ps1

+6
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ function Add-CoderSignature([string] $path) {
7575
--tsaurl $env:EV_TSA_URL `
7676
$path
7777
if ($LASTEXITCODE -ne 0) { throw "Failed to sign $path" }
78+
79+
# Verify that the output exe is authenticode signed
80+
$sig = Get-AuthenticodeSignature $path
81+
if ($sig.Status -ne "Valid") {
82+
throw "File $path is not authenticode signed"
83+
}
7884
}
7985

8086
# CD to the root of the repo

scripts/Release.ps1

+33-33
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
11
# Usage: Release.ps1 -version <version>
22
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,
66

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
1010
)
1111

1212
$ErrorActionPreference = "Stop"
1313

1414
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()
1818

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"
2222

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"
2626

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" }
3535

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+
}
4044
}
41-
else {
42-
Write-Host "Output file is authenticode signed"
45+
finally {
46+
Write-Host "::endgroup::"
4347
}
44-
}
45-
finally {
46-
Write-Host "::endgroup::"
47-
}
4848
}

0 commit comments

Comments
 (0)