From 2eb78b8a561be04f40a671b72fbfc005b99df68a Mon Sep 17 00:00:00 2001 From: Abimael Martell Date: Thu, 2 Apr 2026 14:54:56 -0700 Subject: [PATCH] Upload generated JS bindings from build step instead of napi pre-publish napi pre-publish expects a version-bump commit message convention. Instead, upload index.js and index.d.ts generated by napi build as artifacts and copy them into the publish step. Co-Authored-By: Claude Opus 4.6 --- .github/workflows/publish.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 773ac69..4086a8d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -49,13 +49,23 @@ jobs: working-directory: napi run: bunx napi build --platform --release - - name: Upload artifact + - name: Upload native binary uses: actions/upload-artifact@v4 with: name: bindings-${{ matrix.target }} path: napi/*.node if-no-files-found: error + - name: Upload generated JS bindings + if: matrix.target == 'x86_64-unknown-linux-gnu' + uses: actions/upload-artifact@v4 + with: + name: js-bindings + path: | + napi/index.js + napi/index.d.ts + if-no-files-found: error + publish: name: Publish to npm needs: build @@ -76,23 +86,12 @@ jobs: with: path: napi/artifacts - - uses: oven-sh/setup-bun@v2 - with: - bun-version: latest - - - name: Install dependencies - working-directory: napi - run: bun install - - - name: Generate JS bindings - working-directory: napi - run: bunx napi pre-publish - - name: Collect binaries and publish working-directory: napi run: | - # Copy all .node binaries into the package directory cp artifacts/bindings-*/*.node . + cp artifacts/js-bindings/napi/index.js . + cp artifacts/js-bindings/napi/index.d.ts . echo "=== Package contents ===" ls -la *.node index.js index.d.ts