Skip to content

ci: auto-publish to crates.io on tag release#12

Merged
rrbe merged 2 commits into
masterfrom
ci/auto-publish-crates-io
May 26, 2026
Merged

ci: auto-publish to crates.io on tag release#12
rrbe merged 2 commits into
masterfrom
ci/auto-publish-crates-io

Conversation

@rrbe
Copy link
Copy Markdown
Owner

@rrbe rrbe commented May 26, 2026

Summary

  • Add a `publish-crate` job to `release.yml` that runs after the GitHub Release is created and pushes the crate to crates.io via `cargo publish --locked`.
  • Requires the `CARGO_REGISTRY_TOKEN` repository secret (already configured).

Notes

  • Only affects future `v*` tag pushes. v0.5.0 is already tagged, so it still needs a manual `cargo publish` for that one version.
  • Uses `--locked` so the published artifact matches `Cargo.lock` exactly.
  • Installs `libfontconfig1-dev` to match the build job's Linux dependencies (the crate's dev/build deps may need it during the packaging step).

Test plan

  • Merge, then on the next version bump confirm the workflow run shows a green `publish-crate` job and the new version appears on crates.io.

🤖 Generated with Claude Code

rrbe added 2 commits May 26, 2026 09:12
Adds a publish-crate job after the GitHub Release job so tagged
versions land on crates.io without a manual cargo publish step.
Requires the CARGO_REGISTRY_TOKEN repository secret.
- Pass CARGO_REGISTRY_TOKEN via env, not as shell-interpolated arg
- Gate on tag ref so workflow_dispatch on non-tag commits is skipped
- Verify tag version matches Cargo.toml before publishing
- Drop rust-cache (no prior build step to benefit from it)
@rrbe rrbe merged commit 379be87 into master May 26, 2026
5 checks passed
@rrbe rrbe deleted the ci/auto-publish-crates-io branch May 26, 2026 01: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