diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39608c80..2d2457a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,8 @@ on: - master env: - NODE_BUILD_CMD: npx --no-install prebuild -t 10.12.0 -t 12.13.0 --strip - ELECTRON_BUILD_CMD: npx --no-install prebuild -r electron -t 3.0.0 -t 4.0.0 -t 4.0.4 -t 5.0.0 --strip + NODE_PREBUILD_CMD: npx prebuild -t 10.0.0 -t 12.0.0 -t 14.0.0 -t 16.0.0 --strip + ELECTRON_PREBUILD_CMD: npx prebuild -r electron -t 3.0.0 -t 4.0.0 -t 4.0.4 -t 5.0.0 --strip jobs: @@ -19,8 +19,16 @@ jobs: matrix: os: - windows-2019 + - ubuntu-latest + - macos-latest node: - 10 + - 12 + - 14 + - 16 + # Not supported until superstring is removed or updated to support Node 18+ + # - 18 + # - 20 fail-fast: false name: Testing Node ${{ matrix.node }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -35,3 +43,52 @@ jobs: - run: npm install - run: npm test + + prebuild: + strategy: + matrix: + os: + - ubuntu-latest + - windows-2019 + - macos-latest + node: + - 10 + - 12 + - 14 + - 16 + # Not supported until superstring is removed or updated to support Node 18+ + # - 18 + # - 20 + exclude: + # macos-latest's Python version is too new to work with the node-gyp + # bundled by prebuild and the "overrides" in package.json for node-gyp + # doesn't work before npm 8.3 (Node 16) + - os: macos-latest + node: 10 + - os: macos-latest + node: 12 + - os: macos-latest + node: 14 + fail-fast: false + name: Prebuild with Node ${{ matrix.node }} on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + # needs: test + steps: + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node }} + - run: npm install + - if: matrix.os == 'windows-latest' + run: | + ${{ env.NODE_PREBUILD_CMD }} --arch ia32 + ${{ env.ELECTRON_PREBUILD_CMD }} --arch ia32 + - if: matrix.os == 'macos-latest' + run: | + ${{ env.NODE_PREBUILD_CMD }} --arch arm64 + ${{ env.ELECTRON_PREBUILD_CMD }} --arch arm64 + - run: ${{ env.NODE_PREBUILD_CMD }} + - run: ${{ env.ELECTRON_PREBUILD_CMD }} diff --git a/binding.gyp b/binding.gyp index 8f93e64f..fef8edfe 100644 --- a/binding.gyp +++ b/binding.gyp @@ -49,7 +49,12 @@ ] } ], - 'variables': { 'runtime%': 'node' }, + 'variables': { + 'runtime%': 'node', + 'openssl_fips': '', + 'v8_enable_pointer_compression%': 0, + 'v8_enable_31bit_smis_on_64bit_arch%': 0, + }, 'conditions': [ ['runtime=="electron"', { 'defines': ['NODE_RUNTIME_ELECTRON=1'] }], ] diff --git a/package.json b/package.json index da1e3230..4249a086 100644 --- a/package.json +++ b/package.json @@ -15,17 +15,23 @@ "main": "index.js", "types": "tree-sitter.d.ts", "dependencies": { - "nan": "^2.14.0", - "prebuild-install": "^6.0.1" + "nan": "^2.17.0", + "prebuild-install": "^7.1.1" }, "devDependencies": { - "@types/node": "^14.14.31", - "chai": "^4.3.3", - "mocha": "^8.3.1", - "prebuild": "^10.0.1", + "@types/node": "^20.3.1", + "chai": "^4.3.7", + "mocha": "^8.4.0", + "node-gyp": "^9.4.0", + "prebuild": "^11.0.4", "superstring": "^2.4.2", "tree-sitter-javascript": "https://github.com/tree-sitter/tree-sitter-javascript.git#936d976a782e75395d9b1c8c7c7bf4ba6fe0d86b" }, + "overrides": { + "prebuild": { + "node-gyp": "$node-gyp" + } + }, "scripts": { "install": "prebuild-install || node-gyp rebuild", "build": "node-gyp build",