From 287a7d33f97b83c78878b3ed515b4c5774ef247b Mon Sep 17 00:00:00 2001 From: Xuanwo Date: Wed, 7 Oct 2026 18:39:03 +0800 Subject: [PATCH] fix(release): fail on GitHub binary upload errors --- .github/workflows/npm-publish.yml | 7 +++++++ nodejs/package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml index c3724de8d..028ccd991 100644 --- a/.github/workflows/npm-publish.yml +++ b/.github/workflows/npm-publish.yml @@ -447,6 +447,13 @@ jobs: ARGS="$ARGS --tag preview" fi npm publish $ARGS + - name: Upload release binaries + if: startsWith(github.ref, 'refs/tags/v') + env: + GH_TOKEN: ${{ github.token }} + # napi prepublish logs upload failures without failing the job. + # Keep this separate so a missing release asset fails publication. + run: gh release upload "$GITHUB_REF_NAME" nodejs-artifacts/*.node report-failure: name: Report Workflow Failure runs-on: ubuntu-latest diff --git a/nodejs/package.json b/nodejs/package.json index ce2edd07a..c63b6575e 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -86,7 +86,7 @@ "postdocs": "node typedoc_post_process.js", "lint": "biome check . && biome format .", "lint-fix": "biome check --write . && biome format --write .", - "prepublishOnly": "napi prepublish -t npm", + "prepublishOnly": "napi prepublish -t npm --no-gh-release", "test": "jest --verbose", "integration": "S3_TEST=1 pnpm test", "universal": "napi universalize",