From e9bad6d1f9966e9855f0d851cb43fb5e1c2451e3 Mon Sep 17 00:00:00 2001 From: shum Date: Sat, 10 Oct 2026 12:27:31 +0000 Subject: [PATCH] ci: build nodejs add-on for libs release --- .github/workflows/build.yml | 52 ++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 18346d97de..502ed57e67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -726,7 +726,7 @@ jobs: release-nodejs-libs: runs-on: ubuntu-latest - needs: [build-linux, build-linux-postgres, build-macos] + needs: [build-linux, build-linux-postgres, build-macos, build-nodejs-addon] if: startsWith(github.ref, 'refs/tags/v') && (!cancelled()) steps: - name: Checkout current repository @@ -802,6 +802,14 @@ jobs: mv "${PREFIX}-linux-x86_64-postgres.zip" "$RELEASE_DIR" && cd "$INIT_DIR" fi + - name: Download Node.js add-on artifacts + if: needs.build-nodejs-addon.result == 'success' + uses: actions/download-artifact@v4 + with: + pattern: simplex-nodejs-addon-* + merge-multiple: true + path: ${{ runner.temp }}/release-assets + - name: Create release in libs repo and upload artifacts uses: softprops/action-gh-release@v2 with: @@ -809,3 +817,45 @@ jobs: tag_name: ${{ github.ref_name }} files: ${{ runner.temp }}/release-assets/* token: ${{ secrets.NODEJS_REPO_TOKEN }} + + build-nodejs-addon: + name: "Node.js add-on ${{ matrix.platform }}" + needs: [maybe-release] + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-22.04 + platform: linux-x86_64 + - os: macos-latest + platform: macos-aarch64 + - os: macos-15-intel + platform: macos-x86_64 + - os: windows-latest + platform: windows-x86_64 + defaults: + run: + shell: bash + working-directory: packages/simplex-chat-nodejs + steps: + - name: Checkout Code + uses: actions/checkout@v6 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 22 + + - name: Build add-on + run: | + npm install --ignore-scripts --no-audit --no-fund + npx --yes node-gyp rebuild + cp build/Release/simplex.node build/simplex-chat-nodejs-${{ matrix.platform }}.node + + - name: Upload add-on artifact + uses: actions/upload-artifact@v4 + with: + name: simplex-nodejs-addon-${{ matrix.platform }} + path: packages/simplex-chat-nodejs/build/simplex-chat-nodejs-${{ matrix.platform }}.node + if-no-files-found: error