Skip to content

Commit

Permalink
Use buildjet runners for arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Dec 16, 2023
1 parent b794bd9 commit 75b7618
Showing 1 changed file with 54 additions and 41 deletions.
95 changes: 54 additions & 41 deletions .github/workflows/dummy-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -34,16 +42,16 @@ jobs:
with:
path: prebuilds/**/*.node

build-alpine:
name: Build on Alpine Linux
runs-on: ubuntu-latest
build-linux-arm64:
name: Build for linux-arm64
runs-on: buildjet-2vcpu-ubuntu-2204-arm

container:
image: node:20-alpine
image: node:lts-slim

steps:
- name: Install build deps
run: apk add make g++ python3 git
run: apt update -yq && apt install -yq g++ git make python3

- name: Checkout
uses: actions/checkout@v4
Expand All @@ -61,16 +69,35 @@ jobs:
with:
path: prebuilds/**/*.node

build-arm:
strategy:
matrix:
include:
- arch: aarch64
distro: ubuntu_latest
- arch: aarch64
distro: alpine_latest
build-musl-x64:
name: Build for musl-x64
runs-on: ubuntu-latest

container:
image: node:lts-alpine

steps:
- name: Install build deps
run: apk add --no-cache 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: Build on arm64
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: prebuilds/**/*.node

build-musl-arm64:
name: Build for musl-arm64
runs-on: ubuntu-latest

steps:
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -140,11 +153,11 @@ jobs:

publish:
name: Publish package
runs-on: ubuntu-20.04
needs: [build, build-alpine, build-arm, build-freebsd]
runs-on: ubuntu-latest
needs: [build, build-freebsd-x64, build-linux-arm64, build-musl-arm64, build-musl-x64]

container:
image: node:20-alpine
image: node:alpine

steps:
- name: Checkout
Expand Down

0 comments on commit 75b7618

Please sign in to comment.