From 57aca77f3b306aa6a4e314a4d074bad1d6997a9b Mon Sep 17 00:00:00 2001 From: Seto Elkahfi <1797197+setoelkahfi@users.noreply.github.com> Date: Fri, 20 Nov 2026 07:57:44 +0100 Subject: [PATCH 1/2] ci: fail the crates.io release when a planned crate is missing cargo-workspaces 0.4.2 exits 0 even when crates.io rejects an upload. In v1.5.0 the trusted-publishing token expired after four crates and the other four got a 403, yet the job passed. Add a step that checks every crate in the plan against the crates.io index and fails the job if any is absent. Co-Authored-By: Claude Sonnet 5.5 Co-Authored-By: siGit Code v1.7.10 Co-Authored-By: OndeCode v1.1.2 --- .agents/skills/release/SKILL.md | 5 +++++ .github/workflows/release-sdk-rust.yml | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.agents/skills/release/SKILL.md b/.agents/skills/release/SKILL.md index fefc419..3d5a13d 100644 --- a/.agents/skills/release/SKILL.md +++ b/.agents/skills/release/SKILL.md @@ -141,6 +141,11 @@ here — this is the safety net for step 6. - Workspace-member dev-deps must be path-only (`foo = { path = "../foo" }`), not `foo.workspace = true`. cargo-workspaces strips dev-deps that carry a version, which changes `Cargo.lock` and fails the `--locked` publish (ed-claude 1.4.0). +- The trusted-publishing token is short-lived. In v1.5.0 it expired after four + of the eight crates and the rest got `403 Invalid authentication token`, but + cargo-workspaces 0.4.2 still exited 0. A final step now checks every planned + crate against the crates.io index and fails the job if one is missing. Fix a + failed run by dispatching the workflow again on the same tag (see below). ### `release-sdk-swift.yml` → XCFramework + `ed-swift` diff --git a/.github/workflows/release-sdk-rust.yml b/.github/workflows/release-sdk-rust.yml index 789dec0..eb39cc7 100644 --- a/.github/workflows/release-sdk-rust.yml +++ b/.github/workflows/release-sdk-rust.yml @@ -122,6 +122,28 @@ jobs: --locked \ --publish-interval 15 \ --token "$TOKEN" + # cargo-workspaces 0.4.2 logs "published" and exits 0 even when crates.io + # rejects an upload. In v1.5.0 the trusted-publishing token expired partway + # through and the last four crates got a 403, yet this job went green. So + # ask the registry about every crate in the plan and fail if any is absent. + # After a failure, re-run through workflow_dispatch: the plan then holds + # only the missing crates and the auth step issues a fresh token. + - name: Verify every planned crate reached crates.io + if: steps.plan.outputs.count != '0' + run: | + python3 - <<'PY' > planned.txt + import json + for crate in json.load(open("plan.json")): + print(crate["name"], crate["version"]) + PY + missing=0 + while read -r name version; do + python3 scripts/crates-io-published.py "$version" --crate "$name" --wait || missing=1 + done < planned.txt + if [ "$missing" -ne 0 ]; then + echo "::error::at least one planned crate is not on crates.io; re-run this workflow with publish=true and the same release_tag" + exit 1 + fi - name: Nothing to publish if: steps.plan.outputs.count == '0' run: echo "Every publishable crate at this version is already on crates.io." From b0291f7b08c4072d8c4ece51e5a825d3ed3bb91f Mon Sep 17 00:00:00 2001 From: Seto Elkahfi <1797197+setoelkahfi@users.noreply.github.com> Date: Fri, 20 Nov 2026 08:07:51 +0100 Subject: [PATCH 2/2] Run the crate-publish verification even when publish fails A custom `if` with no status function implies success(), so the verification step was skipped exactly when publish exited nonzero partway through, which is the partial-publish case it exists to catch. Guard with always() so it runs after a failed publish, and gate on the plan step succeeding, since a failed plan leaves count empty and that reads as != '0'. Co-Authored-By: Claude Opus 4.8 Co-Authored-By: siGit Code v1.7.10 Co-Authored-By: OndeCode v1.1.2 --- .github/workflows/release-sdk-rust.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-sdk-rust.yml b/.github/workflows/release-sdk-rust.yml index eb39cc7..454b64c 100644 --- a/.github/workflows/release-sdk-rust.yml +++ b/.github/workflows/release-sdk-rust.yml @@ -128,8 +128,14 @@ jobs: # ask the registry about every crate in the plan and fail if any is absent. # After a failure, re-run through workflow_dispatch: the plan then holds # only the missing crates and the auth step issues a fresh token. + # + # always() so this still runs when publish exits nonzero partway through + # (the --locked failure, or a mid-run token expiry), which is the + # partial-publish case this check exists to catch. A custom `if` + # otherwise implies success() and skips the step there. Gate on plan + # succeeding too: a failed plan leaves count empty, which is != '0'. - name: Verify every planned crate reached crates.io - if: steps.plan.outputs.count != '0' + if: always() && steps.plan.outcome == 'success' && steps.plan.outputs.count != '0' run: | python3 - <<'PY' > planned.txt import json