Skip to content

Commit 7ca1076

Browse files
committed
Added verbose logging to code sign command
1 parent 10a3c68 commit 7ca1076

1 file changed

Lines changed: 17 additions & 19 deletions

File tree

.github/workflows/package.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -102,32 +102,30 @@ jobs:
102102
103103
- name: Sign binaries for Windows
104104
if: ${{ runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }}
105-
shell: bash
105+
shell: pwsh
106106
env:
107107
SM_HOST: ${{ vars.SM_HOST }}
108108
SM_API_KEY: ${{ secrets.SM_API_KEY }}
109109
SM_CLIENT_CERT_FILE: D:\Certificate_pkcs12.p12
110110
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
111111
DIGICERT_KEYPAIR_ALIAS: ${{ secrets.DIGICERT_KEYPAIR_ALIAS }}
112112
run: |
113-
set -e
114-
targetDir="$GITHUB_WORKSPACE/target/x86_64-pc-windows-msvc/release"
115-
failed=0
116-
for exe in spacetimedb-update.exe spacetimedb-cli.exe spacetimedb-standalone.exe; do
117-
echo "Signing $exe..."
118-
output=$(smctl sign --keypair-alias "$DIGICERT_KEYPAIR_ALIAS" \
119-
--input "$targetDir/$exe" 2>&1) || true
120-
echo "$output"
121-
if echo "$output" | grep -q "FAILED"; then
122-
echo "::error::$exe signing FAILED"
123-
failed=1
124-
else
125-
echo "$exe signed successfully"
126-
fi
127-
done
128-
if [ "$failed" -eq 1 ]; then
129-
exit 1
130-
fi
113+
$ErrorActionPreference = 'Continue'
114+
$targetDir = Join-Path $env:GITHUB_WORKSPACE 'target\x86_64-pc-windows-msvc\release'
115+
$failed = $false
116+
foreach ($exe in @('spacetimedb-update.exe','spacetimedb-cli.exe','spacetimedb-standalone.exe')) {
117+
$path = Join-Path $targetDir $exe
118+
Write-Host "Signing $exe..."
119+
& smctl sign --verbose --keypair-alias $env:DIGICERT_KEYPAIR_ALIAS --input $path 2>&1 | Tee-Object -Variable output
120+
$output = $output -join "`n"
121+
if ($output -match 'FAILED') {
122+
Write-Host "::error::$exe signing FAILED"
123+
$failed = $true
124+
} else {
125+
Write-Host "$exe signed successfully"
126+
}
127+
}
128+
if ($failed) { exit 1 }
131129
132130
- name: Verify signatures
133131
if: ${{ runner.os == 'Windows' && startsWith(github.ref, 'refs/tags/') }}

0 commit comments

Comments
 (0)