Skip to content

Commit 6801d2f

Browse files
jacderidaclaude
andcommitted
chore: sign Windows binary with DigiCert EV certificate
Add a sign-windows job to the release workflow that signs ant-node.exe using DigiCert SSM before the post-quantum signing step. The signed binary is repackaged into the release archive. Mirrors the approach used in ant-client. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d92f626 commit 6801d2f

1 file changed

Lines changed: 124 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 124 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,17 +187,135 @@ jobs:
187187
path: ant-node-cli-${{ matrix.friendly_name }}.${{ matrix.archive }}
188188
retention-days: 1
189189

190+
sign-windows:
191+
name: Sign Windows Binary
192+
runs-on: windows-latest
193+
needs: [build]
194+
env:
195+
SM_HOST: ${{ secrets.SM_HOST }}
196+
SM_API_KEY: ${{ secrets.SM_API_KEY }}
197+
SM_CLIENT_CERT_PASSWORD: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
198+
SM_KEYPAIR_ALIAS: ${{ secrets.SM_KEYPAIR_ALIAS }}
199+
SM_LOG_LEVEL: info
200+
SM_LOG_FILE: ${{ github.workspace }}\smctl-signing.log
201+
steps:
202+
- uses: actions/checkout@v4
203+
204+
- uses: actions/download-artifact@v4
205+
with:
206+
name: cli-windows-x64
207+
path: artifacts/
208+
209+
- name: Extract binary for signing
210+
shell: bash
211+
run: |
212+
cd artifacts
213+
7z x *.zip
214+
find . -name "ant-node.exe" -exec cp {} ant-node.exe \;
215+
216+
- name: Create client certificate file
217+
id: prepare_cert
218+
shell: pwsh
219+
run: |
220+
$raw = @'
221+
${{ secrets.SM_CLIENT_CERT_B64 }}
222+
'@
223+
224+
$clean = ($raw -replace '\s','')
225+
226+
if ([string]::IsNullOrWhiteSpace($clean)) {
227+
Write-Error "SM_CLIENT_CERT_B64 is empty after normalization."
228+
exit 1
229+
}
230+
231+
try {
232+
$certBytes = [Convert]::FromBase64String($clean)
233+
} catch {
234+
Write-Error "SM_CLIENT_CERT_B64 is not valid Base64."
235+
exit 1
236+
}
237+
238+
$certPath = Join-Path $env:RUNNER_TEMP "Certificate.p12"
239+
[System.IO.File]::WriteAllBytes($certPath, $certBytes)
240+
241+
"sm_client_cert_b64=$clean" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
242+
243+
- name: Setup DigiCert SSM tools
244+
uses: digicert/ssm-code-signing@v1.2.1
245+
with:
246+
sm_host: ${{ secrets.SM_HOST }}
247+
sm_api_key: ${{ secrets.SM_API_KEY }}
248+
sm_client_cert_b64: ${{ steps.prepare_cert.outputs.sm_client_cert_b64 }}
249+
sm_client_cert_password: ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
250+
251+
- name: Verify smctl installation
252+
shell: pwsh
253+
run: |
254+
smctl -v
255+
smctl healthcheck
256+
257+
- name: Sign ant-node.exe
258+
shell: pwsh
259+
run: |
260+
$file = "artifacts\ant-node.exe"
261+
$result = & smctl sign --keypair-alias "$env:SM_KEYPAIR_ALIAS" --input "$file" 2>&1
262+
if ($LASTEXITCODE -ne 0) {
263+
Write-Error "Signing failed: $result"
264+
exit 1
265+
}
266+
Write-Host "Successfully signed ant-node.exe"
267+
268+
- name: Verify signature
269+
shell: pwsh
270+
run: |
271+
$sig = Get-AuthenticodeSignature "artifacts\ant-node.exe"
272+
Write-Host "Status: $($sig.Status)"
273+
Write-Host "Signer: $($sig.SignerCertificate.Subject)"
274+
if ($sig.Status -ne "Valid") {
275+
Write-Error "Signature validation failed"
276+
exit 1
277+
}
278+
279+
- name: Repackage signed archive
280+
shell: bash
281+
run: |
282+
staging="ant-node-cli-windows-x64"
283+
rm -rf "$staging"
284+
mkdir "$staging"
285+
cp artifacts/ant-node.exe "$staging/"
286+
cp config/bootstrap_peers.toml "$staging/"
287+
(cd "$staging" && 7z a "../${staging}.zip" ./*)
288+
289+
290+
- uses: actions/upload-artifact@v4
291+
with:
292+
name: signed-windows-x64
293+
path: ant-node-cli-windows-x64.zip
294+
retention-days: 1
295+
190296
sign:
191297
name: Sign Releases
192-
needs: [build]
298+
needs: [build, sign-windows]
193299
runs-on: ubuntu-latest
194300
steps:
195-
- name: Download all artifacts
301+
- name: Download build artifacts (excluding signed)
196302
uses: actions/download-artifact@v4
197303
with:
304+
pattern: cli-*
198305
path: artifacts
199306
merge-multiple: true
200307

308+
- name: Download signed Windows artifact
309+
uses: actions/download-artifact@v4
310+
with:
311+
name: signed-windows-x64
312+
path: artifacts-signed-win
313+
314+
- name: Replace Windows archive with signed version
315+
run: |
316+
rm -f artifacts/ant-node-cli-windows-x64.zip
317+
cp artifacts-signed-win/*.zip artifacts/
318+
201319
- name: List artifacts
202320
run: ls -la artifacts/
203321

@@ -322,6 +440,10 @@ jobs:
322440
ant-keygen verify --key release-signing-key.pub --input <file> --signature <file>.sig
323441
```
324442
443+
The Windows binary (`ant-node.exe`) is additionally signed with a DigiCert EV
444+
code-signing certificate. Windows will verify this signature automatically on
445+
download and execution.
446+
325447
SHA256 checksums provided in `SHA256SUMS.txt`.
326448
327449
### Auto-Upgrade

0 commit comments

Comments
 (0)