ci: actually build arm64 binaries, & publish releases to gh #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
workflow_call: | |
concurrency: | |
group: ${{github.workflow}}-${{github.ref}} | |
cancel-in-progress: true | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- macos-latest | |
- ubuntu-latest | |
node: | |
- 18 | |
- 20 | |
- 22 | |
fail-fast: false | |
name: Test Node ${{ matrix.node }} on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
fetch-depth: 0 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node }} | |
- name: Install dependencies | |
run: npm ci --legacy-peer-deps | |
- name: Build x64 binary | |
run: npm x -- prebuildify --napi --arch x64 -t 20.9.0 | |
- name: Set up cross-compilation | |
if: runner.os == 'Linux' | |
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 --napi --arch arm64 -t 20.9.0 | |
- name: Run tests | |
run: npm test | |
- uses: actions/upload-artifact@v4 | |
if: github.ref_type == 'tag' && matrix.node == 20 | |
with: | |
path: prebuilds/** | |
name: prebuilds-${{matrix.os}} | |
retention-days: 2 |