Skip to content

ci(release): add cargo publish step for crates.io on tag#23

Merged
saurabhjain1592 merged 2 commits intomainfrom
ci/release-cratesio-publish
May 5, 2026
Merged

ci(release): add cargo publish step for crates.io on tag#23
saurabhjain1592 merged 2 commits intomainfrom
ci/release-cratesio-publish

Conversation

@saurabhjain1592
Copy link
Copy Markdown
Member

Summary

Mirrors the publish-on-tag pattern from the four established SDKs (PyPI / npm / Maven Central). On every v* tag push, release.yml now also publishes to crates.io.

Order:

  1. preflight — CHANGELOG section + Cargo.toml version match
  2. test — cargo test + build examples
  3. release — GH release with the CHANGELOG body
  4. publish-cratesio (new) — runs cargo publish + verifies the version is live

Failure isolation: publish-cratesio runs after release. If crates.io has a transient issue, the GH release is still up — fix-forward by setting the secret + running cargo publish locally one time, or cutting a patch tag.

Setup required before first tag

Add CARGO_REGISTRY_TOKEN as a repo secret. Generate at https://crates.io/me. Without it, publish-cratesio fails loudly with an actionable error pointing to the right URL.

Test plan

  • yaml.safe_load clean
  • No unsafe ${{ toJSON(...) }} patterns
  • Real validation happens on first v* tag push — only the publish-cratesio job is new; the rest of release.yml has run before

Contributor acknowledgement

  • DCO sign-off
  • CONTRIBUTING.md
  • MIT
  • Branch: ci/release-cratesio-publish

Mirrors the PyPI (axonflow-sdk-python) / npm (axonflow-sdk-typescript) /
Maven Central (axonflow-sdk-java) publish-on-tag pattern.

The new `publish-cratesio` job runs after `release` (GH release creation),
so a transient crates.io outage does not erase the GH release. The job:

1. Checks the CARGO_REGISTRY_TOKEN secret is configured (fails loudly with
   an actionable error otherwise — generate at https://crates.io/me).
2. Runs `cargo publish`.
3. Waits 30s for registry propagation, then verifies the version is live
   via crates.io's public API.

Order in release.yml:
  preflight (CHANGELOG + Cargo.toml version match)
    → test (cargo test + build examples)
    → release (GH release with extracted body)
    → publish-cratesio (crates.io)

If CARGO_REGISTRY_TOKEN isn't set, only publish-cratesio fails — GH release
is already live. Fix-forward: set the secret + run `cargo publish` locally
one time, OR cut a patch tag.

Signed-off-by: Saurabh Jain <saurabhjain1592@gmail.com>
…tree

integration.yml landed (PR #20) before dependabot's bumps for actions/checkout
4→6 (#13) and actions/upload-artifact 4→7 (#10) — those PRs only touched
files that existed at PR-creation time. Aligning integration.yml's pins so
all four workflows are on the same major versions. Pure metadata change.

Signed-off-by: Saurabh Jain <saurabhjain1592@gmail.com>
@saurabhjain1592 saurabhjain1592 merged commit b979d7a into main May 5, 2026
9 checks passed
@saurabhjain1592 saurabhjain1592 deleted the ci/release-cratesio-publish branch May 5, 2026 13: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