From ca425655bf865c2dd475c3265d45c5541c145498 Mon Sep 17 00:00:00 2001 From: Ranieri Althoff Date: Sat, 16 Dec 2023 02:31:51 +0100 Subject: [PATCH] Use buildjet runners for arm64 --- .github/workflows/dummy-release.yml | 96 ++++++++++++++++------------- 1 file changed, 53 insertions(+), 43 deletions(-) diff --git a/.github/workflows/dummy-release.yml b/.github/workflows/dummy-release.yml index ddb0726..6e59408 100644 --- a/.github/workflows/dummy-release.yml +++ b/.github/workflows/dummy-release.yml @@ -6,9 +6,17 @@ jobs: build: strategy: matrix: - os: [ubuntu-20.04, macos-11, macos-m1, windows-2019] - - name: Build on ${{ matrix.os }} + include: + - os: ubuntu-20.04 + arch: linux-x64 + - os: macos-11 + arch: darwin-x64 + - os: macos-m1 + arch: darwin-arm64 + - os: windows-2019 + arch: win32-x64 + + name: Build for ${{ matrix.arch }} runs-on: ${{ matrix.os }} steps: @@ -34,8 +42,35 @@ jobs: with: path: prebuilds/**/*.node - build-alpine: - name: Build on Alpine Linux + build-linux-arm64: + name: Build for linux-arm64 + runs-on: buildjet-2vcpu-ubuntu-2204-arm + + container: + image: node:20 + + steps: + - name: Install build deps + run: apt update -yq && apt install -yq g++ git make python3 + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + + - name: Install dependencies + run: yarn install --frozen-lockfile --ignore-scripts + + - name: Prebuild + run: yarn build + + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + path: prebuilds/**/*.node + + build-musl-x64: + name: Build for musl-x64 runs-on: ubuntu-latest container: @@ -43,7 +78,7 @@ jobs: steps: - name: Install build deps - run: apk add make g++ python3 git + run: apk add --no-cache g++ git make python3 - name: Checkout uses: actions/checkout@v4 @@ -61,16 +96,8 @@ jobs: with: path: prebuilds/**/*.node - build-arm: - strategy: - matrix: - include: - - arch: aarch64 - distro: ubuntu_latest - - arch: aarch64 - distro: alpine_latest - - name: Build on arm64 + build-musl-arm64: + name: Build for musl-arm64 runs-on: ubuntu-latest steps: @@ -82,28 +109,14 @@ jobs: - name: Prebuild uses: uraimo/run-on-arch-action@v2 with: - arch: ${{ matrix.arch }} - distro: ${{ matrix.distro }} + arch: aarch64 + distro: alpine_latest setup: mkdir -p "${PWD}/artifacts" - dockerRunArgs: --volume "${PWD}:/repo" + dockerRunArgs: --volume "${PWD}:/repo" --workdir /repo install: | - case "${{ matrix.distro }}" in - ubuntu*) - apt update -yq - apt install -yq ca-certificates curl g++ gnupg make python3 - 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_20.x nodistro main" >> /etc/apt/sources.list.d/nodesource.list - apt update -yq - apt install -yq nodejs yarn - ;; - alpine*) - apk add --update make g++ python3 - apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.19/main/ nodejs~=20 yarn - ;; - esac - + apk add --update make g++ python3 + apk add --no-cache --repository https://dl-cdn.alpinelinux.org/alpine/v3.19/main/ nodejs~=20 yarn run: | - cd /repo yarn install --frozen-lockfile --ignore-scripts yarn build @@ -112,8 +125,8 @@ jobs: with: path: prebuilds/**/*.node - build-freebsd: - name: Build on FreeBSD + build-freebsd-x64: + name: Build for freebsd-x64 runs-on: ubuntu-latest steps: @@ -122,7 +135,7 @@ jobs: with: submodules: true - - name: Package artifacts + - name: Prebuild uses: vmactions/freebsd-vm@v1 with: envs: "npm_config_build_from_source" @@ -140,11 +153,8 @@ jobs: publish: name: Publish package - runs-on: ubuntu-20.04 - needs: [build, build-alpine, build-arm, build-freebsd] - - container: - image: node:20-alpine + runs-on: ubuntu-latest + needs: [build, build-freebsd-x64, build-linux-arm64, build-musl-arm64, build-musl-x64] steps: - name: Checkout