Skip to content

Commit

Permalink
ci: fix build/release CI (#148)
Browse files Browse the repository at this point in the history
* fix gyp

* Install setuptools

* remove unnecessary setup python

* fix release

* remove deprecated runners

* add macos-13

* add node 20 and 21

* switch from setuptools to latest npm

* add apt update

* fix job name

* remove npm latest

* chore: add in musl prebuilds for node 20/21

---------

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
  • Loading branch information
phenylshima and vladfrangu authored Mar 9, 2024
1 parent 814e500 commit c12c103
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 42 deletions.
47 changes: 26 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ on:
branches:
- '**'
jobs:
build_x86_64:
name: Build x86_64
build_x86_64_legacy_nodejs:
name: Build x86_64 (legacy Node.js)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [12, 13, 14, 15, 16, 17]
os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [12, 13, 14, 15, 16, 17, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -26,20 +26,25 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.8'

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

- name: Package prebuild
run: npm run build

build_x86_64_node_ge_18:
name: Build x86_64 node >= 18
build_x86_64:
name: Build x86_64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18, 19]
os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18, 20, 21]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -56,14 +61,14 @@ jobs:
run: npm run build

build_musl_x86_64:
name: Build x86_64(musl)
name: Build x86_64 (musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18, 19]
node: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand All @@ -79,14 +84,14 @@ jobs:
- name: Package prebuild
run: npm run build

build_aarch64:
name: Prebuild aarch64
build_aarch64_legacy_nodejs:
name: Prebuild aarch64 (legacy Node.js)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
node: [12, 13, 14, 15, 16, 17]
os: [ubuntu-20.04, ubuntu-22.04]
node: [12, 13, 14, 15, 16, 17, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -101,17 +106,17 @@ jobs:

- name: Package prebuild
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt update -y && 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
build_aarch64_node_ge_18:
name: Prebuild aarch64 node >= 18
build_aarch64:
name: Prebuild aarch64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
node: [18, 19]
node: [18, 20, 21]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -126,18 +131,18 @@ jobs:

- name: Package prebuild
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt update -y && 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
build_musl_aarch64:
name: Prebuild aarch64(musl)
name: Prebuild aarch64 (musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18, 19]
node: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand Down
47 changes: 26 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ on:
release:
types: [published]
jobs:
build_x86_64:
name: Prebuild x86_64
build_x86_64_legacy_nodejs:
name: Prebuild x86_64 (legacy Node.js)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [12, 13, 14, 15, 16, 17]
os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [12, 13, 14, 15, 16, 17, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -20,6 +20,11 @@ jobs:
with:
node-version: ${{ matrix.node }}

- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.8'

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

Expand All @@ -33,14 +38,14 @@ jobs:
with:
path: 'build/stage/**/*.tar.gz'

build_x86_64_node_ge_18:
name: Build x86_64 node >= 18
build_x86_64:
name: Prebuild x86_64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, macos-11, macos-12, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18, 19]
os: [macos-11, macos-12, macos-13, ubuntu-20.04, ubuntu-22.04, windows-2019]
node: [18, 20, 21]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -64,14 +69,14 @@ jobs:
path: 'build/stage/**/*.tar.gz'

build_musl_x86_64:
name: Prebuild x86_64(musl)
name: Prebuild x86_64 (musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18, 19]
node: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand All @@ -94,14 +99,14 @@ jobs:
with:
path: 'build/stage/**/*.tar.gz'

build_aarch64:
name: Prebuild aarch64
build_aarch64_legacy_nodejs:
name: Prebuild aarch64 (legacy Node.js)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04, ubuntu-22.04]
node: [12, 13, 14, 15, 16, 17]
os: [ubuntu-20.04, ubuntu-22.04]
node: [12, 13, 14, 15, 16, 17, 19]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -116,7 +121,7 @@ jobs:

- name: Package prebuild
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt update -y && 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
Expand All @@ -126,14 +131,14 @@ jobs:
with:
path: 'build/stage/**/*.tar.gz'

build_aarch64_node_ge_18:
name: Prebuild aarch64 node >= 18
build_aarch64:
name: Prebuild aarch64
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
node: [18, 19]
node: [18, 20, 21]
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -148,7 +153,7 @@ jobs:

- name: Package prebuild
run: |
sudo apt install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
sudo apt update -y && 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
Expand All @@ -159,14 +164,14 @@ jobs:
path: 'build/stage/**/*.tar.gz'

build_musl_aarch64:
name: Prebuild aarch64(musl)
name: Prebuild aarch64 (musl)
runs-on: ubuntu-latest
container:
image: node:${{ matrix.node }}-alpine
strategy:
fail-fast: false
matrix:
node: [12, 13, 14, 15, 16, 17, 18, 19]
node: [12, 13, 14, 15, 16, 17, 18, 19, 20, 21]
steps:
- name: Setup env with Node v${{ matrix.node }}
run: |
Expand Down

0 comments on commit c12c103

Please sign in to comment.