Skip to content

Commit

Permalink
Add aarch64 build
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Ray committed Nov 11, 2023
1 parent 05187f9 commit 1758aff
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
37 changes: 35 additions & 2 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
pull_request:

jobs:
build:
build-x64:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand All @@ -27,10 +27,10 @@ jobs:
path: ${{ env.VCPKG_INSTALLATION_ROOT }}
key: ${{ runner.os }}-${{ env.cache-name }}
if: ${{ matrix.os == 'windows-latest' }}

- name: Install linux deps
run: sudo apt update && sudo apt install -y libcurl4-openssl-dev
if: ${{ matrix.os == 'ubuntu-latest' }}

- name: Install windows deps
run: vcpkg install curl openssl --triplet=x64-windows-static
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -47,3 +47,36 @@ jobs:
with:
name: ${{ matrix.os }}
path: ./prebuilds
build-aarch64:
# The host should always be Linux
runs-on: ubuntu-latest
name: Build on aarch64
steps:
- uses: actions/checkout@v3
- uses: uraimo/run-on-arch-action@v2
name: Run commands
with:
arch: aarch64
distro: ubuntu_latest
run: |
# install deps
apt update
apt install -y libcurl4-openssl-dev git cmake build-essential libssl-dev
# Install nodejs
apt install -y ca-certificates curl gnupg
mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_18.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list
apt update
apt install -y nodejs
# Build
git config --global --add safe.directory '*'
npm run fetch-deps
npm run build-transmission
npm i
npm test
npm run prebuild-arm64
- uses: actions/upload-artifact@v3
with:
name: ubuntu-latest
path: ./prebuilds
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"install": "node-gyp-build",
"test": "standard && node --test test.js",
"prebuild": "prebuildify --napi --strip",
"prebuild-arm64": "prebuildify --napi --strip --arch=arm64",
"fetch-deps": "git submodule update --recursive --init",
"build-transmission": "node ./scripts/build-transmission.js"
},
Expand Down

0 comments on commit 1758aff

Please sign in to comment.