Skip to content

Publish to crates.io from the release workflow - #4

Merged
valenfys merged 1 commit into
mainfrom
publish-to-crates-io
Sep 2, 2026
Merged

valenfys merged 1 commit into
mainfrom
publish-to-crates-io

Conversation

@valenfys

@valenfys valenfys commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds a publish-crate job to .github/workflows/release.yml, run after release succeeds so a version tag (v*.*.*) both cuts the GitHub release (with prebuilt binaries) and publishes to crates.io in the same run.
  • Runs cargo publish --locked, authenticated via a CARGO_REGISTRY_TOKEN secret.

Required manual setup (cannot be done from here)

Before this workflow can actually publish, add a repo secret:

  1. Generate a crates.io API token scoped to this crate (crates.io → Account Settings → API Tokens → New Token, scope publish-update; use publish-new for the very first publish).
  2. Add it as CARGO_REGISTRY_TOKEN under Settings → Secrets and variables → Actions in this repo.

Test plan

  • Verified the added YAML parses/indents consistently with the rest of the file.
  • First real tag push will exercise this end-to-end — recommend keeping an eye on the Actions run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKmYgyL2p8FVFu9Wx13t4K

Adds a publish-crate job, gated on the GitHub release succeeding, so
tagging a version (v*.*.*) both cuts a GitHub release with prebuilt
binaries and pushes the crate to crates.io in the same run. Requires
a CARGO_REGISTRY_TOKEN repo secret (crates.io API token scoped to
this crate) to be added manually in GitHub repo settings.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKmYgyL2p8FVFu9Wx13t4K
@valenfys
valenfys merged commit 261c9da into main Sep 2, 2026
3 checks passed
@valenfys
valenfys deleted the publish-to-crates-io branch September 2, 2026 13:51
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