shibd commented on code in PR #238:
URL: 
https://github.com/apache/pulsar-client-node/pull/238#discussion_r1009163207


##########
.github/workflows/ci-build-release-napi.yml:
##########
@@ -125,3 +125,68 @@ jobs:
         with:
           name: ${{matrix.image}}-${{matrix.nodejs}}-${{matrix.cpu.platform}}
           path: build/stage/*/*.tar.gz
+
+  windows-napi:
+    name: Build NAPI windows - Node ${{matrix.nodejs}} - ${{matrix.arch}}
+    runs-on: windows-2022
+    timeout-minutes: 3000
+
+    strategy:
+      fail-fast: false
+      matrix:
+        arch:
+          - x64
+          - x86
+        nodejs:
+          - 16
+          - 18
+    steps:
+      - uses: actions/checkout@v3
+      - name: Use Node.js ${{ matrix.nodejs }}
+        uses: actions/setup-node@v3
+        with:
+          node-version: ${{ matrix.nodejs }}
+          architecture: ${{ matrix.arch }}
+          cache: 'npm'
+
+      - name: Cache CPP Client
+        id: cache-dependencies
+        uses: actions/cache@v3
+        with:
+          path: pkg/windows/
+          key: ${{ runner.os }}-${{ matrix.arch }}-${{ 
hashFiles('tmp-pulsar-client-cpp-version.txt') }}
+
+      - name: Add env vars
+        shell: bash
+        run: |
+          if [ "${{ matrix.arch }}" = "x86" ]; then
+            echo "TARGET=ia32" >> $GITHUB_ENV
+          else
+            echo "TARGET=${{ matrix.arch }}" >> $GITHUB_ENV
+          fi
+
+      - name: Download CPP Client
+        if: steps.cache-dependencies.outputs.cache-hit != 'true'
+        run: |
+          pkg/windows/download-cpp-client.bat ${{ matrix.arch }}
+
+      - name: Build Node binaries lib
+        run: |
+          npm install --ignore-scripts
+          npx node-pre-gyp configure --target_arch=${{ env.TARGET }}
+          npx node-pre-gyp build --target_arch=${{ env.TARGET }}
+
+      - name: Test loading Node binaries lib
+        run: |
+          node pkg/load_test.js
+
+      - name: Package Node binaries lib
+        run: |
+          npx node-pre-gyp package --target_arch=${{ env.TARGET }}
+
+      - name: Upload artifacts
+        uses: actions/upload-artifact@v3
+        if: matrix.nodejs == 16

Review Comment:
   This does not mean that users can only use Node.js 16, because the version 
of [napi](https://nodejs.org/api/n-api.html#node-api-version-matrix) and the 
version of Node.js are controlled separately.
   
   The version of NAPI we use is: 4
   
   
https://github.com/apache/pulsar-client-node/blob/10ef71a0d235955d91bf763d12513eca51948df0/binding.gyp#L37
   
   Then you can compare. `NAPI 4` applies to Node.js > 10. Refer here: 
https://nodejs.org/api/n-api.html#node-api-version-matrix
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to