Skip to content

Commit

Permalink
feat(ci): add prebuilt binaries for linux aarch64 (#122)
Browse files Browse the repository at this point in the history
* feat(ci): add prebuilt binaries for aarch64

* Update .github/workflows/release.yml

Co-authored-by: Noel <buechler.noel@outlook.com>

* fix typo

Co-authored-by: Noel <buechler.noel@outlook.com>
  • Loading branch information
phenylshima and iCrawl authored Jul 3, 2022
1 parent 406249f commit 9fa0d54
Showing 1 changed file with 75 additions and 4 deletions.
79 changes: 75 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ on:
release:
types: [published]
jobs:
build:
name: Prebuild
build_x86_64:
name: Prebuild x86_64
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -32,8 +32,8 @@ jobs:
with:
path: "build/stage/**/*.tar.gz"

build_musl:
name: Prebuild (musl)
build_musl_x86_64:
name: Prebuild x86_64(musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
Expand Down Expand Up @@ -61,3 +61,74 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "build/stage/**/*.tar.gz"


build_aarch64:
name: Prebuild aarch64
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-18.04]
node: [12, 13, 14, 15, 16]
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node v${{ matrix.node }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- name: Install dependencies
run: npm install --build-from-source

- name: Package prebuild
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
CC=aarch64-linux-gnu-gcc CXX=aarch64-linux-gnu-g++ npx node-pre-gyp --target_arch=arm64 configure build package
- name: Upload prebuild asset
uses: icrawl/action-artifact@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "build/stage/**/*.tar.gz"

build_musl_aarch64:
name: Prebuild aarch64(musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
matrix:
node: [12, 13, 14, 15, 16]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
apk add --update
apk add --no-cache ca-certificates git curl build-base python3 g++ make
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup musl cross compiler
run: |
curl -OL https://musl.cc/aarch64-linux-musl-cross.tgz
tar -xzvf aarch64-linux-musl-cross.tgz
$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc --version
- name: Install dependencies
run: npm install --unsafe-perm --build-from-source

- name: Package prebuild
run: |
CC=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc \
CXX=$(pwd)/aarch64-linux-musl-cross/bin/aarch64-linux-musl-g++ \
npx node-pre-gyp --target_arch=arm64 configure build package
- name: Upload prebuild asset
uses: icrawl/action-artifact@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
path: "build/stage/**/*.tar.gz"

0 comments on commit 9fa0d54

Please # to comment.