From e45bff419d14dcf37fadb5f10c64a625d68681e2 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Wed, 18 Mar 2026 13:31:42 -0400 Subject: [PATCH] fix(ci): add npm publish to prod-release and prevent mid-deploy cancellation (#1208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two issues in the pipeline: 1. cancel-in-progress: true could cancel a running deployment when a new push arrives. Deployments should never be interrupted mid-flight. Changed back to false. 2. The prod-release job bumps the version, commits, and tags — but never publishes the release version to npm. The dev-publish step publishes @dev, test-verify promotes to @next, but @latest was never updated. Users running 'npm install -g gsd-pi' would get stale versions. Added 'Build release' and 'Publish release to npm @latest' steps after the git tag push, with idempotent guard for already-published versions. --- .github/workflows/pipeline.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 649617e7f..1c594d3d7 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -8,7 +8,7 @@ on: concurrency: group: pipeline-${{ github.sha }} - cancel-in-progress: true + cancel-in-progress: false permissions: contents: write @@ -168,6 +168,23 @@ jobs: git push origin main git push origin "v${{ steps.release.outputs.version }}" + - name: Build release + run: npm run build + + - name: Publish release to npm @latest + run: | + OUTPUT=$(npm publish 2>&1) && echo "$OUTPUT" || { + if echo "$OUTPUT" | grep -q "cannot publish over the previously published"; then + echo "Version already published — promoting to latest" + npm dist-tag add gsd-pi@${{ steps.release.outputs.version }} latest + else + echo "$OUTPUT" + exit 1 + fi + } + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Create GitHub Release env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}