From 39568425ad25e228dc282a529328035ffa424821 Mon Sep 17 00:00:00 2001 From: Tim Watson Date: Fri, 10 Jul 2026 21:12:18 +0100 Subject: [PATCH] fix(release): stamp package versions after lint/test, not before MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit npm pkg set version reformats package.json (expanding single-line arrays/objects), which biome's formatter rejects — so stamping before the Lint step failed the release for every package. Move the version stamp to immediately before publish so lint/test run on the pristine, biome-clean tree. Nothing embeds its own package.json version at build time, so building before the stamp is safe. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/release.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 83ad178..0ec2de0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,17 +78,14 @@ jobs: - name: Install run: pnpm install --frozen-lockfile - # The tag is the single source of truth for the version, so stamp it onto every workspace - # package. pnpm rewrites the internal `workspace:*` dependencies to this version on publish. - - name: Set package versions from tag - run: pnpm -r exec -- npm pkg set version="${{ steps.version.outputs.version }}" - - name: Build run: pnpm build # Re-run the full suite against the exact tagged commit before publishing. CI already gates # merges to master, but a tag can point at any commit and npm versions cannot be unpublished - # after 72h — a green run here is the last line of defence. + # after 72h — a green run here is the last line of defence. Lint/test run on the pristine + # tree *before* the version stamp: `npm pkg set` rewrites package.json (expanding single-line + # arrays/objects), which biome's formatter rejects — so stamping first would fail lint. - name: Lint run: pnpm lint - name: Tests @@ -96,6 +93,13 @@ jobs: - name: RabbitMQ end-to-end tests run: pnpm --filter @serviceconnect/rabbitmq test:e2e + # The tag is the single source of truth for the version, so stamp it onto every workspace + # package immediately before publish. pnpm rewrites the internal `workspace:*` dependencies + # to this version on publish. Nothing embeds its own package.json version at build time, so + # building before the stamp (above) is safe. + - name: Set package versions from tag + run: pnpm -r exec -- npm pkg set version="${{ steps.version.outputs.version }}" + - name: Publish to npm # --no-git-checks because the version stamp above leaves the tree dirty. run: pnpm -r publish --access public --no-git-checks --tag "${{ steps.version.outputs.dist_tag }}"