CI: publish to crates.io from the same release tag#4
Merged
Conversation
…rew + crates) Adds a dist custom publish job so a version tag ships everything in one pipeline: GitHub binaries, the Homebrew formula, AND every public crate to crates.io. - dist-workspace.toml: publish-jobs = ["homebrew", "./publish-crates"]. - .github/workflows/publish-crates.yml: a workflow_call job that runs `cargo publish --workspace --locked` (cargo resolves the dependency order and skips the publish=false crates: bench, xtask, edge-worker, tmux). Gated on non-prerelease; needs the CARGO_REGISTRY_TOKEN secret. - release.yml: regenerated by `dist generate` — announce now waits on the crates job (only new wiring; no target/version churn). - justfile: a `just publish` recipe as the manual equivalent. Verified: `dist generate --check` is clean; `cargo publish -p waggle-tree/-p waggle-core --dry-run` package and verify (new crate waggle-tree included). Prerequisite (one-time): add a CARGO_REGISTRY_TOKEN repo secret (a crates.io API token owned by a crate owner — the crates are owned by conikeec, currently at 0.4.0 on crates.io). Until then this job fails while the rest of the release still ships. The next tag after the token is set publishes crates.io too.
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.
What
Makes one version tag publish to all sources in one pipeline: GitHub binaries + installer, the Homebrew formula, and every public crate on crates.io.
Today the release ships binaries + brew (cargo-dist), but crates.io was published by hand — so it's a release behind (
0.4.0on crates.io vs0.5.0binaries/brew).How
dist-workspace.toml—publish-jobs = ["homebrew", "./publish-crates"]. The./publish-cratesis a cargo-dist custom publish job, so it runs inside the same release run, in the publish phase, gated on a real (non-prerelease) tag..github/workflows/publish-crates.yml— aworkflow_calljob that runscargo publish --workspace --locked. cargo (1.90+) resolves the dependency order itself and skips thepublish = falsecrates (bench, xtask, edge-worker, tmux).release.yml— regenerated bydist generate(the only change isannouncenow waiting on the crates job; no target/version churn).justfile— ajust publishrecipe as the manual equivalent.Verified
dist generate --checkclean (config round-trips, no drift).cargo publish -p waggle-tree --dry-runand-p waggle-core --dry-runboth package + verify (the newwaggle-treecrate included).Add a
CARGO_REGISTRY_TOKENrepo secret — a crates.io API token owned by a crate owner. Thewaggle-*crates are owned byconikeec(currently0.4.0on crates.io), so a token from that account works. Until the secret exists, this job fails while the binaries, installer, and Homebrew formula still ship — crates.io just stays a release behind.Once the secret is set, the next tag publishes crates.io in lockstep. (To catch
0.5.0up on crates.io specifically, either re-run thev0.5.0release after adding the secret, orjust publishlocally once.)🤖 Generated with Claude Code