@@ -187,17 +187,137 @@ 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+ if [ ! -f "ant-node.exe" ]; then
215+ echo "::error::ant-node.exe not found after extraction"
216+ ls -R
217+ exit 1
218+ fi
219+
220+ - name : Create client certificate file
221+ id : prepare_cert
222+ shell : pwsh
223+ run : |
224+ $raw = @'
225+ ${{ secrets.SM_CLIENT_CERT_B64 }}
226+ '@
227+
228+ $clean = ($raw -replace '\s','')
229+
230+ if ([string]::IsNullOrWhiteSpace($clean)) {
231+ Write-Error "SM_CLIENT_CERT_B64 is empty after normalization."
232+ exit 1
233+ }
234+
235+ try {
236+ [Convert]::FromBase64String($clean) | Out-Null
237+ } catch {
238+ Write-Error "SM_CLIENT_CERT_B64 is not valid Base64."
239+ exit 1
240+ }
241+
242+ Write-Host "::add-mask::$clean"
243+ "sm_client_cert_b64=$clean" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
244+
245+ - name : Setup DigiCert SSM tools
246+ uses : digicert/ssm-code-signing@v1.2.1
247+ with :
248+ sm_host : ${{ secrets.SM_HOST }}
249+ sm_api_key : ${{ secrets.SM_API_KEY }}
250+ sm_client_cert_b64 : ${{ steps.prepare_cert.outputs.sm_client_cert_b64 }}
251+ sm_client_cert_password : ${{ secrets.SM_CLIENT_CERT_PASSWORD }}
252+
253+ - name : Verify smctl installation
254+ shell : pwsh
255+ run : |
256+ smctl -v
257+ smctl healthcheck
258+
259+ - name : Sign ant-node.exe
260+ shell : pwsh
261+ run : |
262+ $file = "artifacts\ant-node.exe"
263+ $result = & smctl sign --keypair-alias "$env:SM_KEYPAIR_ALIAS" --input "$file" 2>&1
264+ if ($LASTEXITCODE -ne 0) {
265+ Write-Error "Signing failed: $result"
266+ exit 1
267+ }
268+ Write-Host "Successfully signed ant-node.exe"
269+
270+ - name : Verify signature
271+ shell : pwsh
272+ run : |
273+ $sig = Get-AuthenticodeSignature "artifacts\ant-node.exe"
274+ Write-Host "Status: $($sig.Status)"
275+ Write-Host "Signer: $($sig.SignerCertificate.Subject)"
276+ if ($sig.Status -ne "Valid") {
277+ Write-Error "Signature validation failed"
278+ exit 1
279+ }
280+
281+ - name : Repackage signed archive
282+ shell : bash
283+ run : |
284+ staging="ant-node-cli-windows-x64"
285+ rm -rf "$staging"
286+ mkdir "$staging"
287+ cp artifacts/ant-node.exe "$staging/"
288+ cp config/bootstrap_peers.toml "$staging/"
289+ (cd "$staging" && 7z a "../${staging}.zip" ./*)
290+
291+
292+ - uses : actions/upload-artifact@v4
293+ with :
294+ name : signed-windows-x64
295+ path : ant-node-cli-windows-x64.zip
296+ retention-days : 1
297+
190298 sign :
191299 name : Sign Releases
192- needs : [build]
300+ needs : [build, sign-windows ]
193301 runs-on : ubuntu-latest
194302 steps :
195- - name : Download all artifacts
303+ - name : Download build artifacts (excluding signed)
196304 uses : actions/download-artifact@v4
197305 with :
306+ pattern : cli-*
198307 path : artifacts
199308 merge-multiple : true
200309
310+ - name : Download signed Windows artifact
311+ uses : actions/download-artifact@v4
312+ with :
313+ name : signed-windows-x64
314+ path : artifacts-signed-win
315+
316+ - name : Replace Windows archive with signed version
317+ run : |
318+ rm -f artifacts/ant-node-cli-windows-x64.zip
319+ cp artifacts-signed-win/*.zip artifacts/
320+
201321 - name : List artifacts
202322 run : ls -la artifacts/
203323
@@ -322,6 +442,10 @@ jobs:
322442 ant-keygen verify --key release-signing-key.pub --input <file> --signature <file>.sig
323443 ```
324444
445+ The Windows binary (`ant-node.exe`) is additionally signed with a DigiCert EV
446+ code-signing certificate. Windows will verify this signature automatically on
447+ download and execution.
448+
325449 SHA256 checksums provided in `SHA256SUMS.txt`.
326450
327451 ### Auto-Upgrade
0 commit comments