From eb47d9e826cd28b883f4c5b641c6523ec2ab6720 Mon Sep 17 00:00:00 2001 From: Marcel Laverdet Date: Thu, 6 Jun 2024 15:40:03 -0500 Subject: [PATCH] Update GitHub workflows Some of these had hardcoded versions (e.g. v18) --- .github/workflows/build.yml | 12 ++++++----- .github/workflows/prebuild.yml | 37 ++++++++++------------------------ package.json | 2 -- 3 files changed, 18 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7d9d2eb..4750b61 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,18 +4,19 @@ on: [push, pull_request] jobs: build-and-test: + name: ${{ matrix.os }} / Node ${{ matrix.node }} runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [ 18.x, 20.x, 22.x ] os: [ ubuntu-latest, macos-latest, windows-latest ] + node: [ 18.x, 20.x, 22.x ] fail-fast: false steps: - uses: actions/checkout@v4 - - name: Use Node.js ${{ matrix.node-version }} + - name: Use Node.js ${{ matrix.node }} uses: actions/setup-node@v4 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node }} - name: Add msbuild to PATH if: matrix.os == 'windows-latest' uses: microsoft/setup-msbuild@v1.3 @@ -39,8 +40,9 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [ 18, 20, 22 ] - container: node:${{ matrix.node-version }}-alpine + node: [ 18, 20, 22 ] + fail-fast: false + container: node:${{ matrix.node }}-alpine steps: - uses: actions/checkout@v4 - name: install build deps diff --git a/.github/workflows/prebuild.yml b/.github/workflows/prebuild.yml index 069cac4..7bb677c 100644 --- a/.github/workflows/prebuild.yml +++ b/.github/workflows/prebuild.yml @@ -7,18 +7,17 @@ on: jobs: prebuild: + name: ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [ 18.x, 20.x, 22.x ] - os: [ ubuntu-latest, macos-latest, windows-latest ] - fail-fast: false + os: [ alpine-latest, ubuntu-latest, macos-latest, windows-latest ] steps: - uses: actions/checkout@v4 - - name: Use Node.js 18.x + - name: Use nodejs uses: actions/setup-node@v4 with: - node-version: 18.x + node-version: latest - name: Add msbuild to PATH if: matrix.os == 'windows-latest' uses: microsoft/setup-msbuild@v1.3 @@ -26,32 +25,18 @@ jobs: if: matrix.os == 'windows-latest' run: | npm install --global node-gyp@latest - - name: Build - run: | - npm install --ignore-scripts - - name: Prebuild - run: | - npm run prebuild - - name: Upload - run: | - npx prebuild --upload ${{ secrets.UPLOAD_TOKEN }} - env: - MAKEFLAGS: -j4 - - prebuild-alpine: - runs-on: ubuntu-latest - container: node:18-alpine3.19 - steps: - - uses: actions/checkout@v4 - - name: install build deps + - name: Install build deps + if: matrix.os == 'alpine-latest' run: | apk add g++ make python3 - - name: Build + - name: Dependencies run: | npm install --ignore-scripts - - name: Prebuild + - name: Build run: | - npm run prebuild + npx prebuild --target 18.0.0 + npx prebuild --target 20.0.0 + npx prebuild --target 22.0.0 - name: Upload run: | npx prebuild --upload ${{ secrets.UPLOAD_TOKEN }} diff --git a/package.json b/package.json index c606fb3..0ec536c 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,6 @@ "scripts": { "install": "prebuild-install || (node-gyp rebuild --release -j max && node-gyp clean)", "rebuild": "node-gyp rebuild --release -j max", - "prebuild": "prebuild", - "upload": "prebuild --upload ${GITHUB_TOKEN}", "lint": "find src -name '*.cc' | xargs -n1 clang-tidy", "test": "node test.js" },