Repository navigation
ci: crates.io publishes by Trusted Publishing, and a release fails when it cannot (C3) - #714
Merged
Merged
Conversation
…en it cannot (C3) From the CI audit of 2026-10-05, with the maintainer's choice of Trusted Publishing (2026-10-05): CARGO_REGISTRY_TOKEN was a repository-wide secret with no environment around it, and a missing token only warned while PyPI still published, so the two channels could split silently. - The crates.io job runs in a crates-io environment that only v* tags can deploy to (created with this change), and rust-lang/crates-io-auth-action exchanges the run's OIDC identity for a short-lived registry token. - A failed exchange or publish fails the job, and PyPI's publish waits on it. - docs/release-checklist.md describes it; the one-time crates.io setup is in the workflow's header.
DrunkOnJava
added a commit
that referenced
this pull request
Oct 18, 2026
#775) ## Summary `RELEASE.md` describes how a release actually lands, and `publish.yml`'s comments stop describing a `wasm` feature and a v0.1.2 tag. ## Motivation The checklist had the release committed and pushed straight to `main` (`git push origin main --tags`) and the crate published by hand (`cargo publish`). `main` takes changes only through pull requests, and since C3 (#714) the publish workflow publishes the crate by Trusted Publishing. It also listed three of the nine files that carry the version, so `CITATION.cff` was still at 0.1.2 (fixed in #772). Following it as written could not produce a release. ## Changes - **Versioning:** every file that carries the version. - **What's in a release:** the release page's contents, the container image, and Trusted Publishing for crates.io and PyPI. - **Checklist:** - Step 5 adds the introduction, the **Upgrading from** list, one heading per group, and credit for outside contributors. - Step 8 opens a release pull request and refreshes the witness observations from its CI run. - Step 9 confirms both registries' trusted publishers. Without crates.io's, the release binaries and the container image publish while crates.io and PyPI do not. - Steps 10 to 12 tag the merged commit, push only the tag, and replace the release's generated notes with the CHANGELOG section. - **Hotfix:** the same tag-and-push flow, and the backport goes through a pull request. - **Post-release:** the docs' latest-release statements move once every channel is checked. - **Release automation:** matches the CI, publish and release-binaries workflows. Dependabot points to `docs/maintaining.md`. No dry run has published to TestPyPI yet. - **`publish.yml`:** two comments. ## Testing N/A: docs and comments only. Every anchor the new text links to exists. `publish.yml` parses, with only its comments changed. ## Breaking changes None.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
From the CI audit of 2026-10-05, with the maintainer's choice of Trusted Publishing.
crates-ioenvironment that onlyv*tags can deploy to. I created that environment along with this change.rust-lang/crates-io-auth-actionexchanges the run's OIDC identity for a short-lived registry token.DrunkOnJava, repositoryrvt-rs, workflowpublish.yml, environmentcrates-io. After the first release publishes this way, theCARGO_REGISTRY_TOKENsecret can be deleted.Nothing runs on this path until a tag is pushed, and no tag is pushed without the maintainer's go-ahead.
Note
Medium Risk
Release pipeline behavior is stricter (no silent crates.io skip) and depends on OIDC/environment configuration; misconfiguration blocks tagged releases until fixed.
Overview
crates.io publishing now uses Trusted Publishing (OIDC) instead of a long-lived
CARGO_REGISTRY_TOKENrepo secret. Thepublish-cratejob runs in acrates-ioGitHub environment (tag-only), requestsid-token: write, andrust-lang/crates-io-auth-actionsupplies a short-lived token tocargo publish.The workflow no longer skips crates.io when a token is missing—it always runs
cargo publishon tag pushes, so auth or registry rejection fails the job and blocks PyPI (unchanged ordering: PyPI stillneeds: publish-crate).Comments in
publish.ymldocument one-time crates.io trusted-publisher setup (GitHub →publish.yml→ environmentcrates-io).docs/release-checklist.mdpost-publish steps now assume a successful publish job rather than optional skip /crates.io: NOT PUBLISHEDnotes.Reviewed by Cursor Bugbot for commit 7eaa946. Configure here.