From 40cb47c639bf6030b54360fba1ff9e51de4f1850 Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Wed, 6 May 2026 12:19:57 +0000 Subject: [PATCH 1/3] Resolve prebuilt binary nesting and add Windows x86 support --- .github/workflows/ci.yml | 18 +++++++++++++++--- .github/workflows/release.yml | 35 +++++++++++++++++++++++------------ 2 files changed, 38 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 145da17..4d5bae3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ on: jobs: test: - name: Test on ${{ matrix.os }} with Node.js ${{ matrix.node-version }} + name: Test on ${{ matrix.os }} ${{ matrix.arch }} with Node.js ${{ matrix.node-version }} runs-on: ${{ matrix.os }} strategy: @@ -19,15 +19,27 @@ jobs: matrix: os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel] node-version: [20.x, 22.x, 24.x] + arch: [x64] + include: + - os: windows-latest + node-version: 20.x + arch: x86 + - os: windows-latest + node-version: 22.x + arch: x86 + - os: windows-latest + node-version: 24.x + arch: x86 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: ${{ matrix.node-version }} + architecture: ${{ matrix.arch }} cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3c918b5..974d40f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,23 +7,33 @@ on: jobs: prebuild: - name: Test on ${{ matrix.os }} with Node.js ${{ matrix.node-version }} + name: Prebuild on ${{ matrix.os }} ${{ matrix.arch }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest, macos-15-intel] - node-version: [20.x, 22.x, 24.x] + include: + - os: ubuntu-latest + arch: x64 + - os: windows-latest + arch: x64 + - os: windows-latest + arch: x86 + - os: macos-latest + arch: x64 + - os: macos-15-intel + arch: x64 steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - - name: Setup Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v4 + - name: Setup Node.js + uses: actions/setup-node@v6 with: - node-version: ${{ matrix.node-version }} + node-version: '22.x' + architecture: ${{ matrix.arch }} cache: 'npm' - name: Install dependencies @@ -40,9 +50,9 @@ jobs: run: npm run prebuild - name: Upload prebuilds - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: - name: ref-napi-prebuild-${{ matrix.os }}-${{ matrix.node-version }} + name: ref-napi-prebuild-${{ matrix.os }}-${{ matrix.arch }} path: prebuilds/ publish: @@ -55,10 +65,10 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v5 + uses: actions/checkout@v6 - name: Setup Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@v6 with: node-version: '22.x' registry-url: 'https://registry.npmjs.org' @@ -71,9 +81,10 @@ jobs: run: npm test - name: Download all prebuilds - uses: actions/download-artifact@v5 + uses: actions/download-artifact@v8 with: path: prebuilds + merge-multiple: true - run: ls -R prebuilds/ - name: Publish to npm From eb18a3d2633275e51aa23c4e689ac4850e2a8a04 Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Wed, 6 May 2026 12:24:05 +0000 Subject: [PATCH 2/3] Remove Node 24.x from Windows x86 matrix (no 32-bit support) --- .github/workflows/ci.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d5bae3..84905ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,9 +27,6 @@ jobs: - os: windows-latest node-version: 22.x arch: x86 - - os: windows-latest - node-version: 24.x - arch: x86 steps: - name: Checkout code From 11ed2648fd157f9af3ce85b7c71556b07f0d9abc Mon Sep 17 00:00:00 2001 From: Gilson Urbano Date: Wed, 6 May 2026 12:51:00 +0000 Subject: [PATCH 3/3] Use running Node version as prebuildify target on all platforms --- .github/workflows/ci.yml | 1 - .github/workflows/release.yml | 1 - package.json | 2 +- scripts/prebuild.js | 10 ++++++++++ 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 scripts/prebuild.js diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84905ec..660acf5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,5 +49,4 @@ jobs: run: npm run test - name: Prebuild - shell: bash run: npm run prebuild diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 974d40f..140a371 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,7 +46,6 @@ jobs: run: npm run test - name: Prebuild - shell: bash run: npm run prebuild - name: Upload prebuilds diff --git a/package.json b/package.json index 11c38f0..e9d6576 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,7 @@ "test": "nyc mocha --expose-gc", "build": "node-gyp rebuild", "install": "node-gyp-build", - "prebuild": "prebuildify --napi --tag-armv --tag-uv --strip", + "prebuild": "node scripts/prebuild.js", "prepack": "([ $(ls prebuilds | wc -l) > '0' ] || (echo 'Some prebuilds are missing'; exit 1))" }, "dependencies": { diff --git a/scripts/prebuild.js b/scripts/prebuild.js new file mode 100644 index 0000000..19456ad --- /dev/null +++ b/scripts/prebuild.js @@ -0,0 +1,10 @@ +const { execFileSync } = require('child_process') + +execFileSync(process.execPath, [ + require.resolve('prebuildify/bin.js'), + '--napi', + '--tag-armv', + '--tag-uv', + '--strip', + '--target', process.versions.node +], { stdio: 'inherit' })