Skip to content

Commit

Permalink
feat(package-npm): use aarch64 gcc for arm64
Browse files Browse the repository at this point in the history
Installing the toolchain is not enough. `CC` & `CXX` must be explicitly
defined. If we set `STRIP` for the `--strip` option then `prebuildify`
won't copy the binary to the `prebuilds` directory for whatever reason.

Fixes #22
  • Loading branch information
ObserverOfTime committed Dec 29, 2024
1 parent 24dafb9 commit 0ddf14c
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/package-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,16 @@ jobs:
cd - > /dev/null
done < <(find . -name grammar.js -not -path './node_modules/*' -not -path './.build/*')
- name: Build x64 binary
run: npm x -- prebuildify --arch x64 -t 20.9.0 --strip
- name: Build arm64 binary
if: runner.os != 'Linux'
run: npm x -- prebuildify --arch arm64 -t 20.9.0 --strip
- name: Build arm64 binary
run: npm x -- prebuildify --arch x64 -t 20.9.0
- name: Set up cross-compilation
if: runner.os == 'Linux'
run: npm x -- prebuildify-cross -i linux-arm64 -t 20.9.0 --strip
run: |-
sudo apt-get update
sudo apt-get install g++-aarch64-linux-gnu
printf '%s\n' >> "$GITHUB_ENV" \
'CC=aarch64-linux-gnu-gcc' 'CXX=aarch64-linux-gnu-g++'
- name: Build arm64 binary
run: npm x -- prebuildify --arch arm64 -t 20.9.0
- name: Upload binaries
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 0ddf14c

Please sign in to comment.