Publish to crates.io from the release workflow - #4
Merged
Merged
Conversation
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
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.
Summary
publish-cratejob to.github/workflows/release.yml, run afterreleasesucceeds so a version tag (v*.*.*) both cuts the GitHub release (with prebuilt binaries) and publishes to crates.io in the same run.cargo publish --locked, authenticated via aCARGO_REGISTRY_TOKENsecret.Required manual setup (cannot be done from here)
Before this workflow can actually publish, add a repo secret:
publish-update; usepublish-newfor the very first publish).CARGO_REGISTRY_TOKENunder Settings → Secrets and variables → Actions in this repo.Test plan
🤖 Generated with Claude Code
https://claude.ai/code/session_01AKmYgyL2p8FVFu9Wx13t4K