Skip to content

Commit 589957f

Browse files
committed
Yet another test with additional logging
1 parent 9b780d5 commit 589957f

1 file changed

Lines changed: 25 additions & 15 deletions

File tree

.github/workflows/package.yml

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ jobs:
9393
$ErrorActionPreference = 'Stop'
9494
# Sync certificates from DigiCert cloud to local Windows certificate store
9595
# This is required so signtool can find the certificate
96-
smctl windows certsync
96+
Write-Host "Syncing certificates from DigiCert cloud..."
97+
smctl windows certsync --verbose
9798
# Run healthcheck to confirm everything is connected
9899
smctl healthcheck
99100
@@ -130,23 +131,32 @@ jobs:
130131
$ErrorActionPreference = 'Stop'
131132
$targetDir = Join-Path $env:GITHUB_WORKSPACE 'target\x86_64-pc-windows-msvc\release'
132133
133-
# Find the code signing certificate synced from DigiCert
134-
$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert | Select-Object -First 1
134+
# Check if certsync placed a code signing certificate in the store
135+
$cert = Get-ChildItem Cert:\CurrentUser\My -CodeSigningCert -ErrorAction SilentlyContinue | Select-Object -First 1
135136
if (-not $cert) {
136-
$cert = Get-ChildItem Cert:\LocalMachine\My -CodeSigningCert | Select-Object -First 1
137+
$cert = Get-ChildItem Cert:\LocalMachine\My -CodeSigningCert -ErrorAction SilentlyContinue | Select-Object -First 1
137138
}
138-
if (-not $cert) {
139-
throw "No code signing certificate found in certificate store"
140-
}
141-
$thumbprint = $cert.Thumbprint
142-
Write-Host "Using certificate: $($cert.Subject) [$thumbprint]"
143139
144-
foreach ($exe in @('spacetimedb-update.exe','spacetimedb-cli.exe','spacetimedb-standalone.exe')) {
145-
$path = Join-Path $targetDir $exe
146-
Write-Host "Signing $exe..."
147-
& signtool.exe sign /sha1 $thumbprint /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 $path
148-
if ($LASTEXITCODE -ne 0) { throw "Signing failed for $exe (exit code $LASTEXITCODE)" }
149-
Write-Host "$exe signed successfully"
140+
if ($cert) {
141+
$thumbprint = $cert.Thumbprint
142+
Write-Host "Found certificate: $($cert.Subject) [$thumbprint]"
143+
Write-Host "Signing with signtool /sha1..."
144+
foreach ($exe in @('spacetimedb-update.exe','spacetimedb-cli.exe','spacetimedb-standalone.exe')) {
145+
$path = Join-Path $targetDir $exe
146+
Write-Host "Signing $exe..."
147+
& signtool.exe sign /sha1 $thumbprint /tr http://timestamp.digicert.com /td SHA256 /fd SHA256 $path
148+
if ($LASTEXITCODE -ne 0) { throw "Signing failed for $exe (exit code $LASTEXITCODE)" }
149+
Write-Host "$exe signed successfully"
150+
}
151+
} else {
152+
Write-Host "No cert in store, using smctl sign with keypair alias..."
153+
foreach ($exe in @('spacetimedb-update.exe','spacetimedb-cli.exe','spacetimedb-standalone.exe')) {
154+
$path = Join-Path $targetDir $exe
155+
Write-Host "Signing $exe..."
156+
& smctl sign --verbose --keypair-alias $env:DIGICERT_KEYPAIR_ALIAS --input $path
157+
if ($LASTEXITCODE -ne 0) { throw "Signing failed for $exe (exit code $LASTEXITCODE)" }
158+
Write-Host "$exe signed successfully"
159+
}
150160
}
151161
152162
- name: Verify signatures

0 commit comments

Comments
 (0)