Skip to content

ci: publish the crates to crates.io after pypi - #104

Merged
prrao87 merged 1 commit into
mainfrom
ci/publish-crates
Oct 31, 2026
Merged

prrao87 merged 1 commit into
mainfrom
ci/publish-crates

Conversation

@prrao87

@prrao87 prrao87 commented Oct 31, 2026

Copy link
Copy Markdown
Member

Why

Publishing the crates was a manual step after every release: wait for PyPI to show the new version, then run cargo publish from a laptop with a long-lived crates.io token. This moves it into the release workflow, so one GitHub release puts the version on both registries.

What changed

  • A new publish-crates job runs after the PyPI publish job succeeds. It is skipped on pull requests and dry runs, the same as publish.
  • It authenticates through crates.io trusted publishing (rust-lang/crates-io-auth-action), so the repository stores no crates.io token. Both crates now have a trusted publisher registered for python-publish.yml and the crates-io environment. That environment only accepts v* tags, like pypi.
  • cargo package builds and verifies both crates before the token is requested, because compiling lance can take close to the token's 30-minute lifetime. cargo publish --no-verify then only uploads. Cargo publishes lance-csr-catalog before lance-csr.
  • The release guide drops the manual step and explains what to do if only the crates job fails. Rerun it on its own; if the catalog was already uploaded, publish lance-csr by hand.

Validation

  • cargo package --locked -p lance-csr-catalog -p lance-csr passes locally, verifying lance-csr against the packaged catalog (3.5 min on a 10-core Mac; I estimate 10 to 15 min on a GitHub runner).
  • cargo publish --locked --no-verify --dry-run with the same packages uploads in the right order.
  • typos passes on the changed docs; the workflow YAML parses.
  • Not tested end to end: the job only runs on a release, so the next release is its first real run. If it fails there, the manual cargo publish still works, since Require trusted publishing is left off on crates.io until a CI release has succeeded.

🤖 Generated with Claude Code

A release now publishes lance-csr-catalog and lance-csr from the same
workflow run, once the PyPI upload succeeds, through crates.io trusted
publishing and the protected crates-io environment. Packaging and
verification run before the 30-minute token is requested.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying lance-csr with  Cloudflare Pages  Cloudflare Pages

Latest commit: 764fb94
Status: ✅  Deploy successful!
Preview URL: https://edbfa33e.lance-csr.pages.dev
Branch Preview URL: https://ci-publish-crates.lance-csr.pages.dev

View logs

@prrao87
prrao87 marked this pull request as ready for review October 31, 2026 20:47
@prrao87
prrao87 merged commit a59a1b4 into main Oct 31, 2026
12 checks passed
@prrao87
prrao87 deleted the ci/publish-crates branch October 31, 2026 20:47
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