From 8b7614a515b544ae96dbcefb943b315783022330 Mon Sep 17 00:00:00 2001 From: Christian Findlay <16697547+MelbourneDeveloper@users.noreply.github.com> Date: Mon, 16 Nov 2026 20:52:39 +1100 Subject: [PATCH] fix(release): install deps before stamping; repair crates.io URL broken by src/ move - stamp-version.mjs imports smol-toml, but ran before npm ci (v0.14.0 release failed with ERR_MODULE_NOT_FOUND) - the crates.io existence check pointed at /api/v1/src/tdbin after the crates/ -> src/ rename - a missing CARGO_REGISTRY_TOKEN now warns instead of aborting the release Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 553f497..0457b9c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,6 +67,11 @@ jobs: echo "version=$VERSION" >> "$GITHUB_OUTPUT" echo "npm_tag=$NPM_TAG" >> "$GITHUB_OUTPUT" + # The stamper parses src/Cargo.toml with smol-toml (no regex on TOML), so the + # frozen dependency tree must exist before it runs. + - name: Install stamper dependencies + run: npm ci --ignore-scripts + # [SWR-VERSION-BUILD-STAMPING] First-class stamper — covered by # src/cli/test/stamp-version.e2e.test.ts. Runner working tree only. - name: Stamp version in all carriers @@ -124,7 +129,9 @@ jobs: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} run: | V="${{ steps.derive.outputs.version }}" - if curl -fsS -A "typediagram-release" "https://crates.io/api/v1/src/tdbin/$V" >/dev/null 2>&1; then + if [ -z "$CARGO_REGISTRY_TOKEN" ]; then + echo "::warning title=tdbin not published::CARGO_REGISTRY_TOKEN secret is missing — tdbin@$V was NOT published to crates.io" + elif curl -fsS -A "typediagram-release" "https://crates.io/api/v1/crates/tdbin/$V" >/dev/null 2>&1; then echo "tdbin@$V already published — skipping" else cargo publish --manifest-path src/Cargo.toml -p tdbin --allow-dirty