Skip to content

Commit

Permalink
Prebuild through GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
verhovsky committed Jun 15, 2023
1 parent d1d2864 commit b52d335
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 3 deletions.
61 changes: 59 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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 }}
Expand All @@ -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 }}
7 changes: 6 additions & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -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'] }],
]
Expand Down

0 comments on commit b52d335

Please sign in to comment.