Skip to content

Commit b451386

Browse files
authored
CircleCI for Windows (#49)
* Test with CircleCI for Windows. * Multiple windows architectures. * Fix. * Fix node path. * Fix issue. * Final config. * Use latest orb.
1 parent 064fc49 commit b451386

2 files changed

Lines changed: 103 additions & 144 deletions

File tree

.circleci/config.yml

Lines changed: 103 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
version: 2.1
2+
3+
orbs:
4+
win: circleci/windows@2.4.0
5+
16
aliases:
27
- &publish-command
38
name: Publish
@@ -15,6 +20,20 @@ aliases:
1520
echo "Not a tagged build - not publishing"
1621
fi
1722
23+
- &publish-command-windows
24+
name: Publish
25+
shell: bash.exe
26+
command: |
27+
export PATH=/c/nodejs:$PATH
28+
COMMIT_MESSAGE=`git log --format=%s -n 1 $CIRCLE_SHA1`
29+
./node_modules/.bin/node-pre-gyp rebuild package testpackage
30+
if [[ ${COMMIT_MESSAGE} =~ "[publish binary]" ]] && [[ "$PUBLISH" == "true" ]]; then
31+
./node_modules/.bin/node-pre-gyp package testpackage
32+
./node_modules/.bin/node-pre-gyp publish $GYP_ARGS
33+
else
34+
echo "Not a tagged build - not publishing"
35+
fi
36+
1837
- &common-build
1938
resource_class: large
2039
working_directory: ~/repo
@@ -50,7 +69,6 @@ aliases:
5069
- run: *publish-command
5170

5271
- &common-macos
53-
resource_class: large
5472
macos:
5573
xcode: "10.2.1"
5674
steps:
@@ -85,7 +103,6 @@ aliases:
85103
<<: *publish-command
86104

87105
- &common-electron-macos
88-
resource_class: large
89106
macos:
90107
xcode: "10.2.1"
91108
steps:
@@ -121,128 +138,179 @@ aliases:
121138
- run:
122139
<<: *publish-command
123140

124-
version: 2
141+
- &common-windows
142+
working_directory: c:\\project
143+
executor:
144+
name: win/default
145+
steps:
146+
- checkout
147+
- run:
148+
name: Setup
149+
command: |
150+
$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';
151+
cd \tmp
152+
Invoke-WebRequest $('https://nodejs.org/dist/v{0}/node-v{0}-win-{1}.zip' -f $env:NODE_VERSION,$env:NODE_ARCH) -OutFile 'node.zip' -UseBasicParsing
153+
Expand-Archive node.zip -DestinationPath C:\
154+
Rename-Item -Path $('C:\node-v{0}-win-{1}' -f $env:NODE_VERSION,$env:NODE_ARCH) -NewName 'C:\nodejs'
155+
156+
$env:PATH = 'C:\nodejs;{0}' -f $env:PATH
157+
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
158+
159+
# npm --vs2015 install --global windows-build-tools
160+
161+
node -v
162+
- run:
163+
name: Install
164+
command: npm install --build-from-source
165+
- run: npm run test
166+
- run:
167+
<<: *publish-command-windows
168+
- store_artifacts:
169+
path: c:\\project\\lib\\binding
170+
# These tests pass, but exit with code 1 on Windows. Disable for now
171+
# - run:
172+
# name: Test Electron
173+
# command: |
174+
# ./node_modules/.bin/electron "test/support/createdb-electron.js"
175+
# ./node_modules/.bin/electron-mocha --timeout 480000
125176
jobs:
126-
build-14.11.0:
177+
build-14:
127178
<<: *common-build
128179
environment:
129180
PUBLISH: true
130181
docker:
131182
- image: circleci/node:14.11.0
132183

133-
build-12.6.0:
184+
build-12:
134185
<<: *common-build
135186
docker:
136187
- image: circleci/node:12.6.0
137188

138-
build-10.16.0:
189+
build-10:
139190
<<: *common-build
140191
docker:
141192
- image: circleci/node:10.16.0
142193

143194
# Node version should match electron's node version.
144195
# See https://github.com/mapbox/node-sqlite3/pull/1367
145-
build-electron-10.1.2:
196+
build-electron-10:
146197
<<: *common-electron-linux
147198
docker:
148199
- image: circleci/node:12.16.3
149200
environment:
150201
ELECTRON_VERSION: "10.1.2"
151202

152-
build-electron-9.3.1:
203+
build-electron-9:
153204
<<: *common-electron-linux
154205
docker:
155206
- image: circleci/node:12.14.1
156207
environment:
157208
ELECTRON_VERSION: "9.3.1"
158209

159-
build-electron-8.5.2:
210+
build-electron-8:
160211
<<: *common-electron-linux
161212
docker:
162213
- image: circleci/node:12.13.0
163214
environment:
164215
ELECTRON_VERSION: "8.5.2"
165216

166-
build-electron-7.1.14:
217+
build-electron-7:
167218
<<: *common-electron-linux
168219
docker:
169220
- image: circleci/node:12.8.1
170221
environment:
171222
ELECTRON_VERSION: "7.1.14"
172223

173-
build-electron-6.1.9:
224+
build-electron-6:
174225
<<: *common-electron-linux
175226
docker:
176227
- image: circleci/node:12.6.0 # Issues with 12.4.0
177228
environment:
178229
ELECTRON_VERSION: "6.1.9"
179230

180-
build-macos-14.11.0:
231+
build-macos-14:
181232
<<: *common-macos
182233
environment:
183234
PUBLISH: true
184235
NODE_VERSION: "14.11.0"
185236

186-
build-macos-12.6.0:
237+
build-macos-12:
187238
<<: *common-macos
188239
environment:
189240
NODE_VERSION: "12.6.0"
190241

191-
build-macos-10.16.0:
242+
build-macos-10:
192243
<<: *common-macos
193244
environment:
194245
NODE_VERSION: "10.16.0"
195246

196247
# NODE_VERSION should match electron's node version.
197248
# See https://github.com/mapbox/node-sqlite3/pull/1367
198-
build-macos-electron-10.1.2:
249+
build-macos-electron-10:
199250
<<: *common-electron-macos
200251
environment:
201252
ELECTRON_VERSION: "10.1.2"
202253
NODE_VERSION: "12.16.3"
203254

204-
build-macos-electron-9.3.1:
255+
build-macos-electron-9:
205256
<<: *common-electron-macos
206257
environment:
207258
ELECTRON_VERSION: "9.3.1"
208259
NODE_VERSION: "12.14.1"
209260

210-
build-macos-electron-8.5.2:
261+
build-macos-electron-8:
211262
<<: *common-electron-macos
212263
environment:
213264
ELECTRON_VERSION: "8.5.2"
214265
NODE_VERSION: "12.13.0"
215266

216-
build-macos-electron-7.1.14:
267+
build-macos-electron-7:
217268
<<: *common-electron-macos
218269
environment:
219270
ELECTRON_VERSION: "7.1.14"
220271
NODE_VERSION: "12.8.1"
221272

222-
build-macos-electron-6.1.9:
273+
build-macos-electron-6:
223274
<<: *common-electron-macos
224275
environment:
225276
ELECTRON_VERSION: "6.1.9"
226277
# Issues with 12.4.0
227278
NODE_VERSION: "12.6.0"
228279

280+
# Node 14 - build NAPI 3 and 6
281+
windows-14_x86:
282+
<<: *common-windows
283+
environment:
284+
NODE_VERSION: "14.11.0"
285+
NODE_ARCH: x86
286+
PUBLISH: true
287+
288+
windows-14_x64:
289+
<<: *common-windows
290+
environment:
291+
NODE_VERSION: "14.11.0"
292+
NODE_ARCH: x64
293+
PUBLISH: true
294+
229295
workflows:
230296
version: 2
231297
build_all:
232298
jobs:
233-
- build-14.11.0
234-
- build-12.6.0
235-
- build-10.16.0
236-
- build-electron-10.1.2
237-
- build-electron-9.3.1
238-
- build-electron-8.5.2
239-
- build-electron-7.1.14
240-
- build-electron-6.1.9
241-
- build-macos-14.11.0
242-
- build-macos-12.6.0
243-
- build-macos-10.16.0
244-
- build-macos-electron-10.1.2
245-
- build-macos-electron-9.3.1
246-
- build-macos-electron-8.5.2
247-
- build-macos-electron-7.1.14
248-
- build-macos-electron-6.1.9
299+
- build-14
300+
- build-12
301+
- build-10
302+
- build-electron-10
303+
- build-electron-9
304+
- build-electron-8
305+
- build-electron-7
306+
- build-electron-6
307+
- build-macos-14
308+
- build-macos-12
309+
- build-macos-10
310+
- build-macos-electron-10
311+
- build-macos-electron-9
312+
- build-macos-electron-8
313+
- build-macos-electron-7
314+
- build-macos-electron-6
315+
- windows-14_x86
316+
- windows-14_x64

appveyor.yml

Lines changed: 0 additions & 109 deletions
This file was deleted.

0 commit comments

Comments
 (0)