Skip to content

ci: harden publish workflow (idempotent, checkout v5) - #5

Merged
VladPr merged 1 commit into
mainfrom
ci/harden-publish-workflow
Jul 14, 2026
Merged

ci: harden publish workflow (idempotent, checkout v5)#5
VladPr merged 1 commit into
mainfrom
ci/harden-publish-workflow

Conversation

@VladPr

@VladPr VladPr commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Follow-up to the automated-publishing setup.

  • Idempotent publish: a new step queries the crates.io API for the tag's version and skips auth+publish if it already exists. So a manual publish followed by a tag push (or a re-pushed tag) no-ops green instead of failing at crate version already uploaded — which is exactly the red X the v0.2.0 tag produced.
  • checkout v4 → v5: clears the Node.js 20 is deprecated annotation on the runner.
  • Tag-version guard (tag must match Cargo.toml) and Trusted Publishing (OIDC, no stored token) are unchanged.

Dynamic values use the safe pattern throughout (env vars, quoted expansions; no untrusted input interpolated into run scripts).

First live exercise is the next real release (0.3.0); 0.2.0 already exists, so if this workflow re-ran on v0.2.0 now it would take the new skip path and go green.

Skip auth+publish when the tag's version is already on crates.io (query the
crates.io API), so a manual publish followed by a tag push — or a re-pushed
tag — no-ops green instead of failing at 'already uploaded'. Bump
actions/checkout v4 -> v5 to clear the Node 20 deprecation warning.
@VladPr
VladPr merged commit c74c1df into main Jul 14, 2026
2 checks 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.

1 participant