Skip to content

Publish to crates.io when a version tag is pushed - #13

Merged
setoelkahfi merged 1 commit into
developmentfrom
ci/release-crates-on-tag
Oct 28, 2026
Merged

setoelkahfi merged 1 commit into
developmentfrom
ci/release-crates-on-tag

Conversation

@setoelkahfi

Copy link
Copy Markdown
Collaborator

Releasing 1.3.0 today means dispatching release-crates.yml by hand once per crate and remembering that sigit-si-api goes first. This makes the tag do it, the way the sibling repos work. sigit-si-cli also never got its 1.2.0 on crates.io, so the old flow already let one slip.

On a v*.*.* tag the workflow:

  • checks that every crate under crates/ is at the tag's version, and fails naming the ones that aren't
  • runs cargo test --workspace --locked
  • asks crates.io whether sigit-si-api and sigit-si-cli are already published at that version, and publishes whichever is missing, API first (cargo publish waits for the index, so no sleep)
  • dispatches release-mcp-registry.yml at the tag, even when nothing new was published, since that workflow skips duplicates itself

Publishing still uses Trusted Publishing, so there's no stored token. workflow_dispatch stays for re-runs, with a tag input and a dry_run switch that skips the token, the upload and the dispatch. Runs for the same tag queue instead of cancelling.

The README has a short paragraph on how to cut a release.

Checked locally: actionlint is clean. The version check passes against 1.3.0 and fails for a 1.2.0 tag, naming both crates. The crates.io check returns 200 for sigit-si-api 1.2.0 and 404 for 1.3.0. cargo publish --dry-run --locked -p sigit-si-api packages fine. The CLI dry run can't resolve sigit-si-api 1.3.0 until it's published, which is why the order matters.

Both crates have a Trusted Publisher entry for getsigit/si and release-crates.yml. This PR doesn't tag or publish anything. After it merges, 1.3.0 goes out by merging development into main and pushing v1.3.0.

release-crates.yml was a manual dispatch that published one crate at a
time, so the order (sigit-si-api first) was left to the person running
it. It now runs on a v*.*.* tag, checks that the crate versions match the
tag, runs the workspace tests, and publishes whichever of sigit-si-api
and sigit-si-cli is missing from crates.io, in that order. It keeps
Trusted Publishing, so no token is stored. Once that finishes it
dispatches release-mcp-registry.yml.

workflow_dispatch stays for re-runs, with a tag input and a dry_run
switch that skips the token, the upload and the dispatch.

The README gets a short paragraph on how to cut a release.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@setoelkahfi setoelkahfi self-assigned this Oct 28, 2026
@setoelkahfi
setoelkahfi requested a review from paydii October 28, 2026 11:33

@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 automates crate publishing on a version tag push. The workflow now checks that all crates under crates/ match the tag version, runs tests, checks crates.io for existing versions, and publishes sigit-si-api and sigit-si-cli in order if needed. It uses Trusted Publishing and queues duplicate runs for the same tag. The README now documents the release process. The workflow also always dispatches the MCP registry release, regardless of whether new crates were published. Previous manual steps and single-crate dispatch are replaced by this automated, version-tag-driven flow.


Automated review by siGit Code Review · commit 2d6828b · see the review dashboard

Comment thread .github/workflows/release-crates.yml Resolved
Comment thread .github/workflows/release-crates.yml Resolved
Comment thread .github/workflows/release-crates.yml Resolved
Comment thread .github/workflows/release-crates.yml Resolved

@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.

LGTM, thanks.

@setoelkahfi
setoelkahfi merged commit da0a200 into development Oct 28, 2026
1 check passed
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.

2 participants