From 98cf07e78a8d383f648f79c5ae1fc8d583eaaf69 Mon Sep 17 00:00:00 2001 From: Michael Whitham Date: Mon, 23 Nov 2026 22:15:36 -0600 Subject: [PATCH 1/2] Stage the npm package from a file path, and tag only after staging. npm read `npm-tarball/` as a GitHub repository and refused to fetch it, so the v2.1.3 release stopped at staging. The path now starts with `./`. The tested commit is now tagged after the package is staged, so a failed staging leaves no tag and a fixed workflow can release the same version again. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/release-cross-platform.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-cross-platform.yml b/.github/workflows/release-cross-platform.yml index 46f0504b..7a82027d 100644 --- a/.github/workflows/release-cross-platform.yml +++ b/.github/workflows/release-cross-platform.yml @@ -168,6 +168,12 @@ jobs: } EOF (cd archives && sha256sum * > SHA256SUMS && cat SHA256SUMS) + - name: Stage the checked tarball on npm for the maintainer to approve + # The `./` makes npm read a file path. Without it, npm reads + # `npm-tarball/` as a GitHub repository and refuses to fetch it. + run: npm stage publish "./npm-tarball/$(node -p "require('./npm-tarball/pack-summary.json').tarball")" + # Tag only after the package is staged. A failed staging then leaves no + # tag, so a fixed workflow can release the same version from a new commit. - name: Tag the tested commit if: github.ref_type != 'tag' env: @@ -200,8 +206,6 @@ jobs: echo "::error::$TAG already names commit $existing." exit 1 fi - - name: Stage the checked tarball on npm for the maintainer to approve - run: npm stage publish "npm-tarball/$(node -p "require('./npm-tarball/pack-summary.json').tarball")" - name: Publish the checked archives as the GitHub release env: GH_TOKEN: ${{ github.token }} From 49999cc87208f68932c82557e2afd522fc9de155 Mon Sep 17 00:00:00 2001 From: Michael Whitham Date: Mon, 23 Nov 2026 22:27:35 -0600 Subject: [PATCH 2/2] Run the npm staging command as a dry run in the full check. The release stages the packed tarball with `npm stage publish`. The full check now runs the same command with `--dry-run`, with the same Node and npm, so a command that cannot read the file fails before a release tags anything. The job holds no npm credential and sends nothing to npm. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/validate.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c6024052..3506b721 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -229,6 +229,28 @@ jobs: path: npm-tarball if-no-files-found: error + # The release stages this tarball with `npm stage publish` (D251). This job + # runs the same command with `--dry-run`, with the same Node and npm, so a + # command that cannot read the file fails here, before a release tags anything. + # Keep the command the same as the staging step in release-cross-platform.yml. + # This job holds no npm credential and sends nothing to npm. + npm-stage-dry-run: + name: npm stage (dry run) + needs: npm-pack + runs-on: ubuntu-latest + steps: + - uses: actions/setup-node@v4 + with: + node-version: 24 + - name: Use the npm the release uses + run: npm install -g npm@12 && npm --version + - uses: actions/download-artifact@v4 + with: + name: npm-tarball + path: npm-tarball + - name: Stage the checked tarball without sending it + run: npm stage publish --dry-run "./npm-tarball/$(node -p "require('./npm-tarball/pack-summary.json').tarball")" + # Each system installs the same packed tarball into an empty folder. Only the # smoke scripts are checked out; the source tree and build tools stay out of reach. npm-smoke: