Skip to content

ci: publish to crates.io via trusted publishing - #14

Merged
setoelkahfi merged 2 commits into
developmentfrom
ci/crates-io-publish
Oct 13, 2026
Merged

setoelkahfi merged 2 commits into
developmentfrom
ci/crates-io-publish

Conversation

@setoelkahfi

@setoelkahfi setoelkahfi commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds a second release workflow plus the skill that documents the release process.

  • .github/workflows/release-crates.yml — on a v* tag push, publishes the crate to crates.io using trusted publishing. The job requests an OIDC token (permissions: id-token: write), rust-lang/crates-io-auth-action exchanges it for a short-lived crates.io token, and cargo publish --locked consumes it. The action revokes the token in its post step.
  • .agents/skills/release/SKILL.md — the end-to-end release runbook: the one-time trusted-publisher setup, version-bump checklist (Cargo.toml / Cargo.lock / registry/agent.json must agree), the exact CI gate (fmt / clippy -D warnings / test), fast-forwarding main, the annotated tag, and verifying the published release and crate.

Why

Tagging currently publishes binaries but leaves the crate publish as a manual cargo publish on the maintainer's machine. Trusted publishing closes that gap without introducing a long-lived credential: no CARGO_REGISTRY_TOKEN secret to store, rotate, or leak, and the token is scoped to a single job and expires in 30 minutes.

Since crates.io is immutable — a version can be published once, then only yanked, never replaced — the runbook also makes the "bump before you tag" ordering explicit rather than tribal knowledge.

One-time setup required before the first tagged run

Trusted publishing needs a publisher registered on crates.io. It cannot be configured from CI:

crate page → Settings → Trusted Publishing → Add → GitHub:

  • Repository owner: SplitFireAI
  • Repository name: splitfire-agent
  • Workflow filename: release-crates.yml (bare filename, no path)
  • Environment: leave blank (the job declares none)

The crate is already on crates.io (1.2.0), and a first-ever publish would still need a manual token — both prerequisites are satisfied. The workflow filename is part of the trust claim, so renaming the workflow breaks publishing until crates.io is updated to match.

Notes for review

  • The action is pinned to v1.0.5, not @v1. The crates.io docs example shows @v1, but rust-lang/crates-io-auth-action publishes no moving v1 tag — only v1.0.0–v1.0.5 — so @v1 fails to resolve. Verified via git ls-remote and the REST refs API. Worth revisiting if a moving tag appears.
  • actions/checkout@v5 matches the existing workflows (the docs example uses @v6).
  • cargo publish --locked is intentionally not continue-on-error: a failed publish should surface loudly.
  • The skill documents tagging from a commit on main (previous tags are plain annotated, message Release vX.Y.Z), which is unchanged by this PR.

Test plan

  • cargo fmt -- --check
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo test --locked
  • CI green on this PR
  • Dry run locally from a v*-versioned commit: cargo publish --locked --dry-run
  • First real check is the next tag: confirm the release-crates job authenticates and publishes, alongside the five-target release job

No source changes, so the matrix should be quick.

Add release-crates.yml, which runs `cargo publish --locked` when a v* tag
is pushed, using the CARGO_REGISTRY_TOKEN secret. Also add the release
skill documenting the version-bump checklist, the fmt/clippy/test gate,
fast-forwarding main, tagging, and verifying the published GitHub release
and crate.

Co-Authored-By: SplitFire v1.1.1-acp <noreply@splitfire.ai>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a new GitHub Actions workflow release-crates.yml that triggers on v* tags and publishes the crate to crates.io using cargo publish --locked with the CARGO_REGISTRY_TOKEN secret. Also adds a detailed release skill document SKILL.md describing the full release process, including version bump checks, CI gate commands, fast-forwarding main, tagging, and verification steps. This complements the existing release workflow that builds binaries and creates GitHub releases, automating crate publishing and documenting the process clearly.


Automated review by siGit Code Review · commit 7ef4f8d · see the review dashboard

Comment thread .github/workflows/release-crates.yml
@setoelkahfi setoelkahfi self-assigned this Oct 13, 2026
Swap the CARGO_REGISTRY_TOKEN secret for crates.io trusted publishing: the
job requests an OIDC token (permissions: id-token: write),
rust-lang/crates-io-auth-action exchanges it for a short-lived crates.io
token, and cargo publish --locked consumes it. The action revokes the token
in its post step, so there is no long-lived credential in repo secrets.

The action is pinned to v1.0.5 rather than the v1 the crates.io docs show,
because that repo publishes no moving v1 tag and @v1 fails to resolve.

Document the one-time crates.io-side setup in the release skill: a trusted
publisher must name SplitFireAI / splitfire-agent / release-crates.yml, and
the workflow filename is part of the trust claim.

Co-Authored-By: SplitFire v1.1.1-acp <noreply@splitfire.ai>

@sigit-code-review sigit-code-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change introduces a new workflow, .github/workflows/release-crates.yml, which publishes the crate to crates.io on v* tag pushes using trusted publishing via OIDC and the crates-io-auth-action. The accompanying skill documentation, .agents/skills/release/SKILL.md, provides a detailed, step-by-step release runbook, including version bumping, CI gate, tagging, and verification of both GitHub and crates.io releases. The documentation is thorough and matches the workflow implementation. The earlier finding about the need for the CARGO_REGISTRY_TOKEN secret is now addressed by trusted publishing, which does not require a long-lived secret, but does require the trusted publisher to be configured on crates.io for this workflow filename. No source code is changed, only CI and documentation are added. The workflow is safe, but will fail if the trusted publisher is not configured or if the version is already published on crates.io.


Automated review by siGit Code Review · commit cf210b4 · see the review dashboard

@setoelkahfi setoelkahfi changed the title ci: publish crate to crates.io on v* tags ci: publish to crates.io via trusted publishing Oct 13, 2026

@keypair34 keypair34 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅

@setoelkahfi
setoelkahfi merged commit 12705ca into development Oct 13, 2026
2 checks passed
@setoelkahfi
setoelkahfi deleted the ci/crates-io-publish branch October 13, 2026 12:11
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.

3 participants