Repository navigation
Sign the Windows slicec binary in release builds - #825
Conversation
slicec.exe was uploaded to download.zeroc.com unsigned, and IceRpc.Slice.Tools bundles it as is. Sign it with Authenticode on the Windows build leg, before the artifact upload: always for non-nightly releases, and for nightly builds when the new authenticode_sign input is set. A follow-up step checks the signature, so a release build fails instead of publishing an unsigned binary.
There was a problem hiding this comment.
🔵 Needs a closer look
Release signing and publication gating depend on organization secrets and warrant final human review.
Pull request overview
Updates the release workflow to Authenticode-sign Windows slicec.exe before publication.
Changes:
- Adds configurable signing for releases and nightly builds.
- Verifies signatures before artifact upload.
- Blocks publication when required signing fails.
File summaries
| File | Summary |
|---|---|
.github/workflows/build-release.yml |
Adds signing policy, Azure Trusted Signing, verification, and release gating. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
InsertCreativityHere
left a comment
There was a problem hiding this comment.
Looks good, maybe some things could be simplified, maybe not.
One tangential ask, as someone who does test builds off their fork of slicec, could we also check github.repository == 'icerpc/slicec' so the new actions only run for our repository?
Without that, forks will always have red CI, since they can't access our secrets, and so the job would fail.
|
Addressed all three review suggestions in 213c3ca:
Validation: actionlint 1.7.12 and git diff --check pass; all 36 combinations of repository, OS, release quality, and signing opt-in pass; the extracted PowerShell verification script parses and passes four mocked signature cases. Actual Azure signing was not exercised locally. Replied to and resolved both inline review threads. |
(cherry picked from commit 8a8a13b)
The release workflow can publish unsigned first-party binaries when the signing catalog misses a file that `dotnet pack` includes, such as an MSBuild task assembly or a dependency copied into a Tools package. When `authenticode_sign` is enabled, inspect every produced `.nupkg` after both packing steps and require a valid Authenticode signature on every DLL and EXE except an explicit list of bundled third-party files. Temporarily exempt `slicec.exe` until the bundled compiler includes icerpc/slicec#825. Report each invalid signature with its package and entry path, then fail before artifact upload. Fixes #4961. Validation: six temporary PowerShell fixture tests passed, covering valid binaries, multiple invalid signatures across packages, exceptions, exception path matching, missing packages, and corrupt archives. Workflow placement, the signing condition, extraction cleanup, and `git diff --check` also passed. Signature results were simulated on Linux; real Authenticode validation still requires Windows CI. ## What's Changed entry None — this adds a release packaging check with no user-facing API or runtime change.
The release workflow can publish unsigned first-party binaries when the signing catalog misses a file that `dotnet pack` includes, such as an MSBuild task assembly or a dependency copied into a Tools package. When `authenticode_sign` is enabled, inspect every produced `.nupkg` after both packing steps and require a valid Authenticode signature on every DLL and EXE except an explicit list of bundled third-party files. Temporarily exempt `slicec.exe` until the bundled compiler includes icerpc/slicec#825. Report each invalid signature with its package and entry path, then fail before artifact upload. Fixes #4961. Validation: six temporary PowerShell fixture tests passed, covering valid binaries, multiple invalid signatures across packages, exceptions, exception path matching, missing packages, and corrupt archives. Workflow placement, the signing condition, extraction cleanup, and `git diff --check` also passed. Signature results were simulated on Linux; real Authenticode validation still requires Windows CI. ## What's Changed entry None — this adds a release packaging check with no user-facing API or runtime change. (cherry picked from commit 5e7e7dc)
The release workflow uploads
slicec.exeto download.zeroc.com without an Authenticode signature, andIceRpc.Slice.Toolsbundles it unchanged. Thetools/windows-x64/slicec.exeinIceRpc.Slice.Tools0.6.0 on nuget.org isNotSigned, while the managed assemblies in the same package carry ZeroC's signature. This was found while fixing icerpc/icerpc-csharp#4949.This PR signs the Windows binary on the Windows build leg, before the artifact upload, with the same Trusted Signing account, certificate profile and action version as icerpc-csharp's
build-packages.yml:nightly): signing is mandatory.authenticode_signinput (defaultfalse) onworkflow_callandworkflow_dispatch. The scheduled nightly doesn't set it, so it stays unsigned. A manual nightly run can opt in.Get-AuthenticodeSignaturereportsValid, so a signing problem can't lead to an unsigned binary being uploaded. Theuploadjob needsbuild, so nothing is published in that case.The signing action is pinned to a commit SHA, as in icerpc-csharp, because it receives the signing credentials.
Before merging
The
AZURE_TENANT_ID,AZURE_CLIENT_IDandAZURE_CLIENT_SECRETsecrets are organization secrets that are not currently shared with this repository. An org admin needs to addicerpc/slicecto their selected repositories. Until then, a non-nightly release fails at the signing step. The scheduled nightly doesn't sign, so it isn't affected.Testing
actionlint1.7.12 reports no issues.trueforstableandRCwith any input value,falsefornightlyby default, andtruefornightlywithauthenticode_sign: true.slicec.exe.workflow_dispatchwithquality: nightlyandauthenticode_sign: trueexercises it without publishing a stable release.The workflow is the same on
0.4.x, so this commit cherry-picks cleanly and a 0.4.1 release would ship a signedslicec.exe.What's Changed
None - release pipeline change: the published Windows
slicecbinary is now Authenticode-signed; the compiler itself is unchanged.