@@ -3,39 +3,34 @@ name: build
33on :
44 push :
55 branches :
6- - master
6+ - main
77 pull_request :
88 branches :
9- - master
9+ - main
1010 release :
1111 types :
1212 - released
1313 workflow_dispatch : {}
1414
1515env :
1616 # See https://github.com/nodejs/release#release-schedule
17- # Node.js v16 EOL = 2023-09-11. v21 EOL = 2024-06-01.
18- NODE_BUILD_CMD : npx --no-install prebuild -r node -t 18.0.0 -t 20.0.0 -t 22.0.0 -t 23.0.0 --include-regex '_sqlite3'
19- # Merge with NODE_BUILD_CMD when Node.js v18 is EOL
20- NO_V18_NODE_BUILD_CMD : npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 23.0.0 --include-regex '_sqlite3'
21- # See https://www.electronjs.org/docs/latest/tutorial/electron-timelines#version-support-policy
22- # Electron v25 EOL = 2023-12-05. v26 EOL = 2024-02-20. v27 EOL = 2024-04-16. v28 EOL = 2024-06-11. v29 EOL = 2024-08-20.
23-
17+ # Node.js v20 EOL = 2026-04-30. v22 EOL = 2027-04-30. v23 EOL = 2025-06-01. v24 EOL = 2028-04-30.
18+ NODE_BUILD_CMD : npx --no-install prebuild -r node -t 20.0.0 -t 22.0.0 -t 23.0.0 -t 24.0.0 --include-regex '_sqlite3'
2419
2520jobs :
2621 test :
2722 strategy :
2823 matrix :
2924 os :
30- - ubuntu-20 .04
25+ - ubuntu-22 .04
3126 - macos-13
3227 - macos-14
3328 - windows-2019
3429 node :
35- - 18
3630 - 20
3731 - 22
3832 - 23
33+ - 24
3934 name : Testing Node ${{ matrix.node }} on ${{ matrix.os }}
4035 runs-on : ${{ matrix.os }}
4136 steps :
@@ -61,17 +56,18 @@ jobs:
6156 publish :
6257 if : ${{ github.event_name == 'release' }}
6358 name : Publishing to NPM
64- runs-on : ubuntu-20 .04
59+ runs-on : ubuntu-22 .04
6560 needs :
6661 - prebuild
6762 - prebuild-alpine
6863 - prebuild-alpine-arm
64+ - prebuild-linux-x64
6965 - prebuild-linux-arm
7066 steps :
7167 - uses : actions/checkout@v4
7268 - uses : actions/setup-node@v4
7369 with :
74- node-version : 18
70+ node-version : 20
7571 registry-url : https://registry.npmjs.org
7672 - run : npm publish
7773 env :
8379 fail-fast : false
8480 matrix :
8581 os :
86- - ubuntu-20.04
8782 - macos-13
8883 - macos-14
8984 - windows-2019
@@ -94,36 +89,38 @@ jobs:
9489 - uses : actions/checkout@v4
9590 - uses : actions/setup-node@v4
9691 with :
97- node-version : 18
92+ node-version : 20
9893 - if : ${{ startsWith(matrix.os, 'windows') }}
9994 run : pip.exe install setuptools
10095 - if : ${{ startsWith(matrix.os, 'macos') }}
10196 run : brew install python-setuptools
102- - if : ${{ !startsWith(matrix.os, 'windows') && !startsWith(matrix.os, 'macos') }}
103- run : python3 -m pip install setuptools
104- - if : ${{ startsWith(matrix.os, 'ubuntu') }}
105- run : |
106- sudo apt update
107- sudo apt install gcc-10 g++-10 -y
108- sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 100 --slave /usr/bin/g++ g++ /usr/bin/g++-10 --slave /usr/bin/gcov gcov /usr/bin/gcov-10
10997 - run : npm install --ignore-scripts
11098 - run : ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
11199 - if : matrix.os == 'windows-2019'
112100 run : |
113101 ${{ env.NODE_BUILD_CMD }} --arch ia32 -u ${{ secrets.GITHUB_TOKEN }}
114- ${{ env.NO_V18_NODE_BUILD_CMD }} --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}
102+ ${{ env.NODE_BUILD_CMD }} --arch arm64 -u ${{ secrets.GITHUB_TOKEN }}
103+
104+ prebuild-linux-x64 :
105+ if : ${{ github.event_name == 'release' }}
106+ name : Prebuild on Linux x64
107+ runs-on : ubuntu-latest
108+ container : node:20-bullseye
109+ needs : test
110+ steps :
111+ - uses : actions/checkout@v4
112+ - run : npm install --ignore-scripts
113+ - run : ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
115114
116115 prebuild-alpine :
117116 if : ${{ github.event_name == 'release' }}
118- strategy :
119- fail-fast : false
120117 name : Prebuild on alpine
121118 runs-on : ubuntu-latest
122- container : node:18 -alpine
119+ container : node:20 -alpine
123120 needs : test
124121 steps :
125122 - uses : actions/checkout@v4
126- - run : apk add build-base git python3 py3-setuptools --update-cache
123+ - run : apk add build-base git python3 py3-setuptools libstdc++ --update-cache
127124 - run : npm install --ignore-scripts
128125 - run : ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
129126
@@ -142,8 +139,8 @@ jobs:
142139 - uses : actions/checkout@v4
143140 - uses : docker/setup-qemu-action@v3
144141 - run : |
145- docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:18 -alpine -c "\
146- apk add build-base git python3 py3-setuptools --update-cache && \
142+ docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20 -alpine -c "\
143+ apk add build-base git python3 py3-setuptools libstdc++ --update-cache && \
147144 cd /tmp/project && \
148145 npm install --ignore-scripts && \
149146 ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"
@@ -163,7 +160,7 @@ jobs:
163160 - uses : actions/checkout@v4
164161 - uses : docker/setup-qemu-action@v3
165162 - run : |
166- docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:18 -bullseye -c "\
163+ docker run --rm -v $(pwd):/tmp/project --entrypoint /bin/sh --platform linux/${{ matrix.arch }} node:20 -bullseye -c "\
167164 cd /tmp/project && \
168165 npm install --ignore-scripts && \
169- ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"
166+ ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"
0 commit comments