Skip to content

ci: publish crate to crates.io on release - #21

Merged
dialupdisaster merged 2 commits into
mainfrom
feat/crates-io-publish
Oct 8, 2026
Merged

dialupdisaster merged 2 commits into
mainfrom
feat/crates-io-publish

Conversation

@dialupdisaster

Copy link
Copy Markdown
Contributor

Description

Set up crates.io publishing so release-please releases also push to crates.io:

  • Adds a publish job to the Release workflow that runs cargo publish --locked with CARGO_REGISTRY_TOKEN when a v* tag is pushed (guarded by if: startsWith(github.ref, 'refs/tags/v')).
  • Fixes crate metadata: correct repository URL (→ DEVtheOPS/gsbt), adds keywords/categories, and excludes non-crate files (.github, docs, tooling files) from the published package.
  • Also carries over the dependabot ignore for dtolnay/rust-toolchain so that fix lives on main (not only on the release branch).

Verified with cargo publish --dry-run: packages 39 files and builds cleanly.

Type of change

  • New feature
  • Refactor/chore

Checklist

  • I have read CONTRIBUTING.md
  • cargo publish --dry-run passes locally
  • Commit messages follow Conventional Commits

How it works

Merge this → release-please updates the 0.3.0 release PR (#17) to include it → merging #17 tags v0.3.0 → the Release workflow builds the binaries and publishes gsbt 0.3.0 to crates.io.

Dependabot treats the toolchain ref as an action version and bumps it to a
nonexistent tag (e.g. 1.99.0 -> 1.120.0), which breaks the install step.
Ignore that dependency so the bogus PRs stop being opened.
Add a publish job to the Release workflow that runs `cargo publish`
using the CARGO_REGISTRY_TOKEN secret when a v* tag is pushed. Also fix
the crate metadata (repository URL, keywords, categories) and exclude
non-crate files from the published package.
@dialupdisaster
dialupdisaster merged commit 9c4a54d into main Oct 8, 2026
4 checks passed
@dialupdisaster
dialupdisaster deleted the feat/crates-io-publish branch October 8, 2026 19:07
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