Skip to content

Commit

Permalink
ci: prebuildify for linux-arm64
Browse files Browse the repository at this point in the history
Uses https://github.com/pguyot/arm-runner-action to have a native
arm64 linux environment to compile the prebuild for linux-arm64.

prebuildify-cross would be easier, but unfortunately does not work
due to the xtst headers not present in the docker images that
prebuildify-cross uses internally.
  • Loading branch information
csett86 committed Jul 16, 2023
1 parent f67038f commit e992601
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 23 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ jobs:
- os: ubuntu-20.04
arch: x64
build-group: linux-x64
- os: ubuntu-20.04
arch: x64
build-group: linux-arm64
- os: macos-11
arch: x64
build-group: darwin-universal
Expand All @@ -38,17 +41,32 @@ jobs:
with:
node-version: '16'
architecture: ${{ matrix.arch }}
- name: Install linux dependencies
if: startsWith(matrix.os, 'ubuntu')
- name: Prebuildify for linux-arm64
if: ${{ matrix.build-group == 'linux-arm64' }}
uses: pguyot/arm-runner-action@v2
with:
base_image: raspios_lite_arm64:latest
image_additional_mb: 5000
copy_artifact_path: prebuilds
commands: |
curl -fsSL https://deb.nodesource.com/setup_16.x | bash -
apt-get -y install nodejs libxtst-dev libpng++-dev
npm ci
npm run prebuild-$BUILD_GROUP
- name: Install linux x64 dependencies
if: ${{ matrix.build-group == 'linux-x64' }}
run: sudo apt-get install libxtst-dev libpng++-dev
- run: npm ci
if: ${{ matrix.build-group != 'linux-arm64' }}
- name: Prebuildify
if: ${{ matrix.build-group != 'linux-arm64' }}
run: npm run prebuild-$BUILD_GROUP
shell: bash
- uses: actions/upload-artifact@v3
with:
name: prebuilds
path: prebuilds/
if-no-files-found: error
publish:
name: Publish to npm
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
45 changes: 24 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"prebuild": "prebuildify -t 16.0.0 --napi --strip",
"prebuild-darwin-universal": "prebuildify -t 16.0.0 --napi --strip --arch x64+arm64",
"prebuild-linux-x64": "prebuildify -t 16.0.0 --napi --strip",
"prebuild-linux-arm64": "prebuildify -t 16.0.0 --napi --strip",
"prebuild-win32-x86": "prebuildify -t 16.0.0 --napi --strip",
"prebuild-win32-x64": "prebuildify -t 16.0.0 --napi --strip"
},
Expand Down

0 comments on commit e992601

Please sign in to comment.