Repository navigation
Add a release workflow and cargo-binstall metadata - #159
Merged
Merged
Conversation
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.
Adds
.github/workflows/release.ymland[package.metadata.binstall]so a pushedv<version>tag produces a draft GitHub Release thatcargo binstall --git https://github.com/ComlineProject/cli comlinecan install from. Nothing is released by this PR: no tag, no release.Flow
v*tag push: verify the tag equals theCargo.tomlversion (fails otherwise), build the matrix, smoke-test, attest, then one job runsgh release create --draft --verify-tag --generate-noteswith the archives andSHA256SUMS. Tags containing-are marked prerelease. A human publishes the draft.pull_request(only whenrelease.yml,Cargo.tomlorCargo.lockchange) andworkflow_dispatch: build + package only; archives are uploaded as workflow artifacts (7 days). No attest, no release.Targets
Linux is static musl, so the binaries run on the oldest distributions rather than needing glibc 2.39. The Linux legs run inside
ghcr.io/comlineproject/ci-tools@sha256:b9301f9c...(multi-arch; Rust stable, the musl target,musl-tools). The job installs the toolchainrust-toolchain.tomlnames (1.99.1) with the target, and setsCC_<target>=musl-gccso wasmtime'scc-built C helpers compile against musl; musl targets link withcrt-staticby default. harden-runner does not run inside container jobs, so those legs have none (the macOS and Windows legs have none either). No apt.The smoke jobs check the packaged archive on a plain runner:
filereports static (statically linkedon aarch64,static-pie linkedon x86_64),lddreports no dynamic executable,readelfshows no INTERP header and no NEEDED entries, andcomline --versionruns on the runner, indebian:9(glibc 2.24) and inbusybox:1.37.0-uclibc(no glibc), the images pinned by digest. It also fails if the embedded commit isunknown.Archive layout and binstall
comline-<target>.tar.gz(.zipon Windows) containingcomline-<target>/comline[.exe],LICENSE,README.md. PlusSHA256SUMSover all archives, and a build-provenance attestation per archive (actions/attest-build-provenance, in a separate job holding onlyid-token/attestations: write).{ archive-suffix }followspkg-fmt, so the Windows override only changes the format. No override is needed for Linux: cargo-binstall's target detection (detect-targets) returns<arch>-unknown-linux-gnufirst on a glibc host and<arch>-unknown-linux-muslas the fallback, so a gnu host finds no gnu archive and takes the musl one.Conventions
All actions pinned to SHAs (existing org pins reused;
upload-artifactv7.0.2,download-artifactv8.0.2 andattest-build-provenancev4.2.2 resolved from their release tags). Top-levelcontents: read;contents: writeonly on the release job;id-token/attestations: writeonly on the attest job.persist-credentials: false,timeout-minuteseverywhere, harden-runner (audit) on the non-container Linux jobs (smoke, attest, release), pinned runner labels, toolchain read fromrust-toolchain.toml(1.99.1),--locked --release.Two choices to be aware of:
Swatinem/rust-cacheis skipped on tag builds so a release never ships output from an earlier cache.RELEASING.mdgets a short paragraph on the tag-triggered draft release.For you to decide
.minisigper archive plus asigningblock in the binstall metadata once a key exists. The attestations andSHA256SUMSare the integrity story for now.v*tag.