Skip to content

Commit aa6748d

Browse files
committed
build: target Node 12 when building
1 parent 640900f commit aa6748d

File tree

4 files changed

+55
-53
lines changed

4 files changed

+55
-53
lines changed

.github/workflows/CI.yml

Lines changed: 36 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ jobs:
1515
os:
1616
- ubuntu-20.04
1717
- windows-2019
18-
node_version:
19-
- 18
2018
node_arch:
2119
- x64
2220
cpp_arch:
@@ -28,23 +26,19 @@ jobs:
2826

2927
include:
3028
- os: windows-2019
31-
node_version: 18
3229
node_arch: ia32
3330
cpp_arch: amd64_x86
3431

3532
# - os: windows-2022
36-
# node_version: 18
3733
# node_arch: x64
3834
# arch: arm64
3935
# cpp_arch: amd64_arm64
4036

4137
- os: macos-13
42-
node_version: 18
4338
node_arch: x64
4439
cpp_arch: x64
4540

4641
- os: macos-14
47-
node_version: 18
4842
node_arch: arm64
4943
cpp_arch: amd64_arm64
5044

@@ -53,9 +47,8 @@ jobs:
5347
docker: node:18-alpine
5448
docker_cmd:
5549
apk add --no-cache pkgconfig tar python3 build-base cmake ninja
56-
zip unzip curl git musl-dev && npm i -g pnpm && pnpm install &&
57-
pnpm run build
58-
node_version: 18
50+
zip unzip curl git musl-dev gcc g++ && npm i -g pnpm && pnpm
51+
install && pnpm run build
5952
node_arch: x64
6053
cpp_arch: x64
6154

@@ -76,9 +69,9 @@ jobs:
7669
./build/
7770
key:
7871
# prettier-ignore
79-
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-ZMQ_DRAFT:${{env.npm_config_zmq_draft }}-Node:${{ matrix.node_version}}-${{hashFiles('./package.json') }}"
72+
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch}}-ZMQ_DRAFT:${{env.npm_config_zmq_draft }}-${{hashFiles('./package.json') }}"
8073
restore-keys: |
81-
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ env.npm_config_zmq_draft }}-Node:${{ matrix.node_version }}-"
74+
"cache-OS:${{ matrix.os }}-arch:${{ matrix.node_arch }}-ZMQ_DRAFT:${{ env.npm_config_zmq_draft }}-"
8275
8376
- name: Env map
8477
run: |
@@ -98,18 +91,6 @@ jobs:
9891
vcpkg: true
9992
architecture: ${{ matrix.cpp_arch }}
10093

101-
- uses: pnpm/action-setup@v4
102-
if: ${{ !matrix.docker }}
103-
with:
104-
version: 9
105-
106-
- name: Install Node
107-
if: ${{ !matrix.docker }}
108-
uses: actions/setup-node@v4
109-
with:
110-
node-version: ${{ matrix.node_version }}
111-
architecture: ${{ env.setup_node_arch }}
112-
11394
- name: Install Mac-OS x86_64 Dependencies
11495
if: ${{ contains(matrix.os, 'macos') && matrix.node_arch == 'x64' }}
11596
run: |
@@ -123,13 +104,43 @@ jobs:
123104
echo "PATH=$PATH" >> $GITHUB_ENV
124105
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
125106
107+
- uses: pnpm/action-setup@v4
108+
if: ${{ !matrix.docker }}
109+
with:
110+
version: 9
111+
112+
- name: Install Node 18
113+
if: ${{ !matrix.docker }}
114+
uses: actions/setup-node@v4
115+
with:
116+
node-version: 18
117+
architecture: ${{ env.setup_node_arch }}
118+
126119
- name: Install Dependencies
127120
if: ${{ !matrix.docker }}
128121
run: pnpm install
129122

130-
- name: Build
123+
- name: Build JavaScript
124+
if: ${{ !matrix.docker }}
125+
run: pnpm run build.js
126+
127+
- name: Install Node 12
128+
if: ${{ !matrix.docker }}
129+
uses: actions/setup-node@v4
130+
with:
131+
node-version: 12
132+
architecture: ${{ env.setup_node_arch }}
133+
134+
- name: Build Native with Node 12
135+
if: ${{ !matrix.docker }}
136+
run: npm run build.native
137+
138+
- name: Use Node 18
131139
if: ${{ !matrix.docker }}
132-
run: pnpm run build
140+
uses: actions/setup-node@v4
141+
with:
142+
node-version: 18
143+
architecture: ${{ env.setup_node_arch }}
133144

134145
- name: Prebuild Docker
135146
if: ${{ matrix.docker }}

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,5 @@ set_target_properties(addon PROPERTIES PREFIX "" SUFFIX ".node")
7474
# Windows workaround
7575
if(WIN32)
7676
set_property(TARGET addon PROPERTY LINK_FLAGS "-Xlinker /DELAYLOAD:NODE.EXE")
77-
target_link_libraries(addon "ShLwApi.lib" "delayimp.lib")
77+
target_link_libraries(addon PRIVATE "ShLwApi.lib" "delayimp.lib")
7878
endif()

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,9 @@ Install **ZeroMQ.js** with prebuilt binaries:
4343
npm install zeromq
4444
```
4545

46-
Requirements for using prebuilt binaries:
46+
Supported versions:
4747

48-
- Node.js 10.2+ or Electron 3+ (requires a
49-
[N-API](https://nodejs.org/api/n-api.html) version 3+)
48+
- Node.js v12 (requires a [N-API](https://nodejs.org/api/n-api.html))
5049

5150
### Prebuilt binaries
5251

package.json

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
}
6969
},
7070
"engines": {
71-
"node": ">= 10.2",
71+
"node": ">= 12",
7272
"pnpm": ">= 9"
7373
},
7474
"files": [
@@ -123,67 +123,59 @@
123123
"configurations": [
124124
{
125125
"name": "linux-x64",
126-
"dev": true,
127126
"os": "linux",
128127
"arch": "x64",
129128
"runtime": "node",
130-
"runtimeVersion": "14.20.0"
129+
"runtimeVersion": "12.22.12"
131130
},
132131
{
133-
"name": "win-x64",
134-
"dev": true,
132+
"name": "windows-x64",
135133
"os": "win32",
136134
"arch": "x64",
137135
"runtime": "node",
138-
"runtimeVersion": "14.20.0"
136+
"runtimeVersion": "12.22.12"
139137
},
140138
{
141-
"name": "macos-x64",
142-
"dev": true,
139+
"name": "darwin-x64",
143140
"os": "darwin",
144141
"arch": "x64",
145142
"runtime": "node",
146-
"runtimeVersion": "14.20.0"
143+
"runtimeVersion": "12.22.12"
147144
},
148145
{
149-
"name": "macos-arm64",
150-
"dev": true,
146+
"name": "darwin-arm64",
151147
"os": "darwin",
152148
"arch": "arm64",
153149
"runtime": "node",
154-
"runtimeVersion": "14.20.0"
150+
"runtimeVersion": "12.22.12"
155151
},
156152
{
157-
"name": "linux-x64",
158-
"dev": true,
153+
"name": "linux-x64-electron",
159154
"os": "linux",
160155
"arch": "x64",
161156
"runtime": "electron",
162-
"runtimeVersion": "14.20.0"
157+
"runtimeVersion": "12.22.12"
163158
},
164159
{
165-
"name": "win-x64",
166-
"dev": true,
160+
"name": "windows-x64-electron",
167161
"os": "win32",
168162
"arch": "x64",
169163
"runtime": "electron",
170-
"runtimeVersion": "14.20.0"
164+
"runtimeVersion": "12.22.12"
171165
},
172166
{
173-
"name": "macos-x64",
174-
"dev": true,
167+
"name": "darwin-x64-electron",
175168
"os": "darwin",
176169
"arch": "x64",
177170
"runtime": "electron",
178-
"runtimeVersion": "14.20.0"
171+
"runtimeVersion": "12.22.12"
179172
},
180173
{
181-
"name": "macos-arm64",
182-
"dev": true,
174+
"name": "darwin-arm64-electron",
183175
"os": "darwin",
184176
"arch": "arm64",
185177
"runtime": "electron",
186-
"runtimeVersion": "14.20.0"
178+
"runtimeVersion": "12.22.12"
187179
}
188180
],
189181
"targetDirectory": "build",

0 commit comments

Comments
 (0)