From 0861764964ec94459bc63a2eb71ef4faa606f370 Mon Sep 17 00:00:00 2001 From: femshima <49227365+femshima@users.noreply.github.com> Date: Sun, 6 Mar 2022 10:09:34 +0900 Subject: [PATCH 1/3] feat(ci): add prebuilt binaries for aarch64 --- .github/workflows/release.yml | 80 +++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 10c4ea0..28a1c94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: @@ -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 @@ -61,3 +61,75 @@ 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 compoiler + 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" From d49b7413e741d94bdf5c8809a003f01383771fd1 Mon Sep 17 00:00:00 2001 From: femshima <49227365+femshima@users.noreply.github.com> Date: Mon, 7 Mar 2022 06:23:02 +0900 Subject: [PATCH 2/3] Update .github/workflows/release.yml Co-authored-by: Noel --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 28a1c94..f7084d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -87,7 +87,6 @@ jobs: 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: From 4cb72f7885f0b793001851250a9da7b4430a142d Mon Sep 17 00:00:00 2001 From: femshima <49227365+femshima@users.noreply.github.com> Date: Mon, 7 Mar 2022 06:27:13 +0900 Subject: [PATCH 3/3] fix typo --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f7084d0..880cfc4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -111,7 +111,7 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Setup musl cross compoiler + - name: Setup musl cross compiler run: | curl -OL https://musl.cc/aarch64-linux-musl-cross.tgz tar -xzvf aarch64-linux-musl-cross.tgz