Repository navigation
ci(release): sign and publish through the shared workflow - #87
Merged
Merged
Conversation
SignPath signs only an executable whose ProductName is the project name and whose ProductVersion is set. build.rs now embeds ProductName and FileDescription "Colony" and ProductVersion and FileVersion from CARGO_PKG_VERSION, through winresource without default features, and only when the target is Windows. The Windows CI leg builds colony.exe and fails if either field is not what is expected.
The build legs now only build, smoke-test and upload each binary as an artifact. The new sign-and-publish job calls Project-Colony-Resources/.github/workflows/sign-and-publish.yml, pinned by commit, which checks the draft, Authenticode-signs colony-windows.exe through SignPath once signpath-project-slug is set, writes .sig, .meta and .meta.sig over the final bytes, uploads them to the draft, downloads and verifies them, and publishes. Asset names, the .meta format, the draft hold and the AUR job chained after signing are unchanged. Also: no build cache in the release legs (SignPath forbids it), a read-only token without persisted credentials for the build legs, per-job permissions, a check of the Windows version resource against the tag, and a corrected note on why the draft hold is a gh call.
The README gets the "Code signing policy" section SignPath Foundation asks for, with the team roles and a privacy policy that lists every server Colony contacts, when, and what it sends, as the code does it. The release signing guide and the workflow template pointer now describe the shared sign-and-publish workflow and the Authenticode step before ed25519 signing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Colony's release now signs and publishes through the organisation's shared workflow,
Project-Colony-Resources/.github/workflows/sign-and-publish.yml, pinned at619460ff4dc0049f129955f0988d368427b9eedb. It also adds what SignPath Foundation needs before it can Authenticode-signcolony-windows.exe. SignPath stays off:signpath-project-slugis commented out until the project is accepted.Release workflow (
release-please.yml)build-<asset>). They no longer upload to the release.signjob is replaced bysign-and-publish, which calls the shared workflow. It checks that the release is still a draft, runs Authenticode through SignPath once enabled, then writes.sig,.metaand.meta.sigover the final bytes. It uploads everything to the draft, downloads it again, verifies every signature and digest, and only then publishes. Authenticode rewrites the PE, so the ed25519 signing has to come after it.colony-linux,colony-windows.exe,colony-macosandcolony-macos-x86, each with.sig,.metaand.meta.sig. These are the nameslauncher_asset_name()and the self-update download ask for..metaformat, byte for byte.targetjob that refuses a published tag.aur-publish.yml, still chained withneeds:after signing. It is aworkflow_call, so the GITHUB_TOKEN publish inside the shared workflow does not need to trigger anything.rust-cache, because SignPath forbids reusing unverified build outputs.permissions: {}at the top. The build legs getcontents: read, and their checkout does not persist credentials, because they run every dependency's build script.VersionInfo.ProductName == "Colony"andProductVersion == <tag without v>right after the smoke test.inherit.release-type: rustis kept. I corrected the comment that explained why. It said manifest mode would change the action's outputs. In release-please-action v5 both modes go through the sameoutputReleases, and the root package's outputs are unprefixed. The accurate reason for the gh-based draft hold is simpler: the action ignores config files wheneverrelease-typeis set.gh workflow run release-please.yml --ref vX.Y.Z -f tag=vX.Y.Z. With SignPath on, the shared workflow refuses a run whose commit is not the tag's.Windows version resource
build.rsuseswinresource(no default features, so it only addsversion_check, which is already in the lockfile). It embeds ProductName and FileDescription "Colony", and ProductVersion and FileVersion fromCARGO_PKG_VERSION. It does this only whenCARGO_CFG_TARGET_OSiswindows.colony.exeand checks both fields, so this PR proves it on windows-latest. The checks use-cne, because PowerShell's-neignores case and the crate default would be "colony".x86_64-pc-windows-msvc(llvm-rc and lld-link with an xwin sysroot). The releasecolony.execarries a VERSIONINFO resource with ProductNameColony, ProductVersion0.10.4, FileVersion0.10.4and FileDescriptionColony.README
## Code signing policysection with the SignPath Foundation attribution, the team roles, and a note that Windows builds ship without Authenticode until SignPath accepts the project.docs/release-signing.mdand the template pointer now describe the new flow.Checked locally
cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo test(150 passed), all with isolated XDG dirs.Only proven at the next release
sign-and-publish.