Skip to content

ci: auto-publish Rust crates to crates.io on release#272

Merged
DorianZheng merged 1 commit intomainfrom
ci/cargo-publish
Feb 16, 2026
Merged

ci: auto-publish Rust crates to crates.io on release#272
DorianZheng merged 1 commit intomainfrom
ci/cargo-publish

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Add publish_crates job to build-runtime.yml that publishes Rust crates to crates.io after runtime tarballs are uploaded to GitHub Release
  • Publishes in dependency order: leaf crates (Tier 1) → wait 60s → boxlite (Tier 2)
  • Handles "already uploaded" gracefully for idempotent re-runs
  • Add publish = false to boxlite-ffi (path-only dep would fail publish)
  • Document CARGO_REGISTRY_TOKEN secret in workflows README

Pre-requisite

Create CARGO_REGISTRY_TOKEN secret in repo settings (generate at https://crates.io/settings/tokens with publish-new + publish-update scopes).

Test plan

  • actionlint passes on workflow YAML
  • BOXLITE_DEPS_STUB=1 cargo publish --dry-run passes for all 6 crates
  • cargo package --list confirms vendor dirs excluded, proto files included
  • End-to-end: create a pre-release after merging and verify the publish_crates job succeeds

Add `publish_crates` job to build-runtime workflow that publishes
boxlite and its dependency crates to crates.io after runtime tarballs
are uploaded to the GitHub Release.

- Publish leaf crates first (boxlite-shared, *-sys), wait 60s for
  crates.io indexing, then publish boxlite
- Use BOXLITE_DEPS_STUB=1 to skip native builds during verification
- boxlite uses --no-verify (shim binary links libkrun, unavailable
  in stub mode; real build already succeeded)
- Handle "already uploaded" gracefully for idempotent re-runs
- Add publish=false to boxlite-ffi (path-only dep would fail publish)
- Document CARGO_REGISTRY_TOKEN secret in workflows README
@DorianZheng DorianZheng merged commit 546a513 into main Feb 16, 2026
14 checks passed
@DorianZheng DorianZheng deleted the ci/cargo-publish branch February 16, 2026 01:38
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