@@ -3,39 +3,34 @@ name: build
3
3
on :
4
4
push :
5
5
branches :
6
- - master
6
+ - main
7
7
pull_request :
8
8
branches :
9
- - master
9
+ - main
10
10
release :
11
11
types :
12
12
- released
13
13
workflow_dispatch : {}
14
14
15
15
env :
16
16
# 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'
24
19
25
20
jobs :
26
21
test :
27
22
strategy :
28
23
matrix :
29
24
os :
30
- - ubuntu-20 .04
25
+ - ubuntu-22 .04
31
26
- macos-13
32
27
- macos-14
33
28
- windows-2019
34
29
node :
35
- - 18
36
30
- 20
37
31
- 22
38
32
- 23
33
+ - 24
39
34
name : Testing Node ${{ matrix.node }} on ${{ matrix.os }}
40
35
runs-on : ${{ matrix.os }}
41
36
steps :
@@ -61,17 +56,18 @@ jobs:
61
56
publish :
62
57
if : ${{ github.event_name == 'release' }}
63
58
name : Publishing to NPM
64
- runs-on : ubuntu-20 .04
59
+ runs-on : ubuntu-22 .04
65
60
needs :
66
61
- prebuild
67
62
- prebuild-alpine
68
63
- prebuild-alpine-arm
64
+ - prebuild-linux-x64
69
65
- prebuild-linux-arm
70
66
steps :
71
67
- uses : actions/checkout@v4
72
68
- uses : actions/setup-node@v4
73
69
with :
74
- node-version : 18
70
+ node-version : 20
75
71
registry-url : https://registry.npmjs.org
76
72
- run : npm publish
77
73
env :
83
79
fail-fast : false
84
80
matrix :
85
81
os :
86
- - ubuntu-20.04
87
82
- macos-13
88
83
- macos-14
89
84
- windows-2019
@@ -94,36 +89,38 @@ jobs:
94
89
- uses : actions/checkout@v4
95
90
- uses : actions/setup-node@v4
96
91
with :
97
- node-version : 18
92
+ node-version : 20
98
93
- if : ${{ startsWith(matrix.os, 'windows') }}
99
94
run : pip.exe install setuptools
100
95
- if : ${{ startsWith(matrix.os, 'macos') }}
101
96
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
109
97
- run : npm install --ignore-scripts
110
98
- run : ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
111
99
- if : matrix.os == 'windows-2019'
112
100
run : |
113
101
${{ 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 }}
115
114
116
115
prebuild-alpine :
117
116
if : ${{ github.event_name == 'release' }}
118
- strategy :
119
- fail-fast : false
120
117
name : Prebuild on alpine
121
118
runs-on : ubuntu-latest
122
- container : node:18 -alpine
119
+ container : node:20 -alpine
123
120
needs : test
124
121
steps :
125
122
- 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
127
124
- run : npm install --ignore-scripts
128
125
- run : ${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}
129
126
@@ -142,8 +139,8 @@ jobs:
142
139
- uses : actions/checkout@v4
143
140
- uses : docker/setup-qemu-action@v3
144
141
- 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 && \
147
144
cd /tmp/project && \
148
145
npm install --ignore-scripts && \
149
146
${{ env.NODE_BUILD_CMD }} -u ${{ secrets.GITHUB_TOKEN }}"
@@ -163,7 +160,7 @@ jobs:
163
160
- uses : actions/checkout@v4
164
161
- uses : docker/setup-qemu-action@v3
165
162
- 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 "\
167
164
cd /tmp/project && \
168
165
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