Skip to content

CI: publish to crates.io from the same release tag#4

Merged
conikeec merged 1 commit into
mainfrom
ci/crates-io-publish
Jul 13, 2026
Merged

CI: publish to crates.io from the same release tag#4
conikeec merged 1 commit into
mainfrom
ci/crates-io-publish

Conversation

@conikeec

Copy link
Copy Markdown
Contributor

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.0 on crates.io vs 0.5.0 binaries/brew).

How

  • dist-workspace.tomlpublish-jobs = ["homebrew", "./publish-crates"]. The ./publish-crates is 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 — a workflow_call job that runs cargo publish --workspace --locked. cargo (1.90+) resolves the dependency order itself and skips the publish = false crates (bench, xtask, edge-worker, tmux).
  • release.yml — regenerated by dist generate (the only change is announce now waiting on the crates job; no target/version churn).
  • justfile — a just publish recipe as the manual equivalent.

Verified

  • dist generate --check clean (config round-trips, no drift).
  • cargo publish -p waggle-tree --dry-run and -p waggle-core --dry-run both package + verify (the new waggle-tree crate included).

⚠️ One-time prerequisite before this does anything

Add a CARGO_REGISTRY_TOKEN repo secret — a crates.io API token owned by a crate owner. The waggle-* crates are owned by conikeec (currently 0.4.0 on 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.0 up on crates.io specifically, either re-run the v0.5.0 release after adding the secret, or just publish locally once.)

🤖 Generated with Claude Code

…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.
@conikeec
conikeec merged commit 5b97fc4 into main Jul 13, 2026
13 checks passed
@conikeec
conikeec deleted the ci/crates-io-publish branch July 13, 2026 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant