Repository navigation
Release pipeline: dist binaries, release-plz, npm publishing, cargo-deny, coverage - #24
Open
harlantwood wants to merge 4 commits into
Open
harlantwood wants to merge 4 commits into
harlantwood wants to merge 4 commits into
Conversation
- dist 0.33 (dist-workspace.toml, generated release.yml): `trust` for Linux gnu/musl (x86_64, aarch64), macOS (x86_64, aarch64), Windows x86_64; shell and PowerShell installers; Homebrew formula pushed to trustgraph/homebrew-tap; GitHub build attestations. - release-plz: release PR with version bump and CHANGELOG.md; on merge, publishes trustgraph-core and trustgraph-cli to crates.io and pushes the vX.Y.Z tag. Skips until RELEASE_PLZ_TOKEN exists. - npm.yml: napi-rs cross-compile matrix (8 targets), smoke tests on glibc/musl Linux, macOS and Windows, per-platform packages plus the root package, and @trustgraph/trustgraph-wasm, published with pnpm and provenance on tags (trusted publishing or NPM_TOKEN); dry run on PRs. - install.sh defers to dist's installer, falling back to cargo. - CI: cargo-deny (deny.toml) and cargo-llvm-cov coverage artifact. - trustgraph-core and trustgraph-cli are publishable. - doc/releasing.md: one-time setup and how to cut a release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UdKneRqUnsbv1t7NyvcT68
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UdKneRqUnsbv1t7NyvcT68
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UdKneRqUnsbv1t7NyvcT68
…line-bsuvj4 # Conflicts: # doc/plan/README.md
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.
TL;DR
This is roadmap Phase 2, "Release and publish". Once the release-plz PR is merged, the
vX.Y.Ztag it pushes publishestrustbinaries and installers to a GitHub Release, a Homebrew formula, the crates on crates.io, and both npm packages with provenance. Nothing is published yet and no secrets exist. Release-plz skips itself until its token is set, and PRs never need secrets. doc/releasing.md lists the one-time setup.Binaries (dist 0.33)
dist-workspace.tomlsets the targets:trustfor Linux gnu and musl (x86_64, aarch64), macOS (x86_64, aarch64) and Windows x86_64. It also sets up the shell and PowerShell installers, the Homebrew formulatrustgraph(pushed totrustgraph/homebrew-tap), GitHub build attestations,precise-builds(builds onlytrustgraph-cli) and installs to$XDG_BIN_HOMEor~/.local/bin.Cargo.tomlgains[profile.dist]..github/workflows/release.ymlis generated bydist generate. On PRs it only runsdist plan. Its action versions are pinned in[dist.github-action-commits](checkout@v7 and so on), and Dependabot skips the file (exclude-paths), because dist's CI fails when the file is edited by hand.install.sh
curl | shentry point. It downloadstrustgraph-cli-installer.shfrom the latest release (orTRUST_VERSION) and runs it. That installer detects glibc or musl, checks the SHA-256 and sets up PATH. When there is no release, it falls back tocargo install.TRUST_INSTALL_DIRis passed on, and so are any arguments (sh -s -- --no-modify-path).TRUST_FROM_SOURCE=1forces a source build.cargo install trustgraph-cli.Crates (release-plz)
release-plz.ymlandrelease-plz.toml: there is one shared version and one rootCHANGELOG.md, and the tag isv{{ version }}ontrustgraph-cli. The GitHub Release is left to dist.release_always = false, so a release happens only when the release PR is merged.CARGO_REGISTRY_TOKENis used if it is set. Without it, release-plz uses trusted publishing (OIDC). The empty secret is never passed on, because release-plz treats an empty token as an error.trustgraph-coreandtrustgraph-cliare now publishable.trustgraph-wasmandtrustgraph-nodestaypublish = false. The crate README links are now absolute.npm (
npm.yml)v*tags. PRs that touch the npm pipeline, and manual runs, do everything else and finish withpnpm publish --dry-run.package.json. Linux gnu builds use--use-napi-cross, which gives an old glibc. Linux musl builds use-x(zig).napi create-npm-dirs/napi artifacts) and the root package'soptionalDependencies.@trustgraph/trustgraph-wasm: built byscripts/build-wasm-package.sh, which now also copies README and LICENSE into the package.scripts/npm-publish.sh: publishes withpnpm publish --provenance --access public. It skips versions that are already on npm, so a failed run can be re-run, and sends prereleases to thenexttag.Cargo.toml. Auth is npm trusted publishing, or an optionalNPM_TOKEN.CI
denyjob:EmbarkStudios/cargo-deny-action@v2withdeny.toml. Advisories and yanked crates fail the build. The license allowlist is compatible with Apache-2.0 (MPL-2.0 is allowed foroption-ext). Duplicate crate versions only warn. Unknown registries and git sources fail.coveragejob:cargo-llvm-covover the Rust crates. It uploadslcov.infoand an HTML report as an artifact and adds a summary to the job. No external service is involved.Docs
doc/releasing.mdcovers what ships where, how to cut a release, the one-time setup, how to check the pipeline without publishing, and how to change the setup.RELEASE_PLZ_TOKEN; a crates.io token for the first release, then trusted publishing; creatingtrustgraph/homebrew-tapand addingHOMEBREW_TAP_TOKEN; the npm@trustgraphorg withNPM_TOKENfor the first release, then trusted publishers for all 10 packages.doc/architecture.mdnow points to it.Verified
cargo fmt --check, plus clippy-D warningson the workspace and on core alone, with both stable 1.97 and 1.99. Alsocargo doc -D warnings,cargo test --workspace,check-core-purity.shandshellcheck install.sh scripts/*.sh.cargo publish --dry-run -p trustgraph-core -p trustgraph-clipasses (package, verify build and aborted upload for both).dist planlists the expected 7 archives, the installers andtrustgraph.rb.dist build --artifacts=all --target x86_64-unknown-linux-gnuproduced a working archive. Hand-editingrelease.ymlmakesdist planfail, as expected.install.shagainst a local copy oftarget/distrib. It installedtrust 0.1.0to~/.local/bin, and toTRUST_INSTALL_DIRwith--no-modify-path. With no release it falls back tocargo installfrom git.cargo deny check: all ok. One warning: duplicatesyn.cargo llvm-cov: about 94% line coverage; the HTML report is generated.napi build --use-napi-cross --target x86_64-unknown-linux-gnubuilds, needs only GLIBC_2.14 and passes the smoke test. I ran a fake run ofcreate-npm-dirs+artifacts+ theoptionalDependenciesstep +npm-publish.sh --dry-runfor all 9 native packages. The wasm package passed build, smoke test,pnpm packcontents check and a dry-run publish.actionlinton the workflows: clean, apart from style notes in the generatedrelease.yml.Not in this PR
install-updater = false).🤖 Generated with Claude Code
https://claude.ai/code/session_01UdKneRqUnsbv1t7NyvcT68
Generated by Claude Code