@@ -234,23 +234,32 @@ jobs:
234
234
# It is not feasible to cross-compile with CentOS.
235
235
236
236
# Cross-compile notes: To compile native dependencies for arm64,
237
- # we install the aarch64 cross toolchain and then set it as the default
237
+ # we install the aarch64/armv7l cross toolchain and then set it as the default
238
238
# compiler/linker/etc. with the AR/CC/CXX/LINK environment variables.
239
239
# qemu-user-static on ubuntu-16.04 currently doesn't run Node correctly,
240
- # so we just build with "native"/x86_64 node, then download arm64 node
241
- # and then put it in our release. We can't smoke test the arm64 build this way,
240
+ # so we just build with "native"/x86_64 node, then download arm64/armv7l node
241
+ # and then put it in our release. We can't smoke test the cross build this way,
242
242
# but this means we don't need to maintain a self-hosted runner!
243
- package-linux-arm64 :
244
- name : Linux ARM64 cross-compile build
243
+ package-linux-cross :
244
+ name : Linux cross-compile builds
245
245
needs : build
246
246
runs-on : ubuntu-16.04
247
247
timeout-minutes : 15
248
+ strategy :
249
+ matrix :
250
+ include :
251
+ - prefix : aarch64-linux-gnu
252
+ arch : arm64
253
+ - prefix : arm-linux-gnueabihf
254
+ arch : armv7l
255
+
248
256
env :
249
- AR : aarch64-linux-gnu-ar
250
- CC : aarch64-linux-gnu-gcc
251
- CXX : aarch64-linux-gnu-g++
252
- LINK : aarch64-linux-gnu-g++
253
- NPM_CONFIG_ARCH : arm64
257
+ AR : ${{ format('{0}-ar', matrix.prefix) }}
258
+ CC : ${{ format('{0}-gcc', matrix.prefix) }}
259
+ CXX : ${{ format('{0}-g++', matrix.prefix) }}
260
+ LINK : ${{ format('{0}-g++', matrix.prefix) }}
261
+ NPM_CONFIG_ARCH : ${{ matrix.arch }}
262
+ NODE_VERSION : v14.17.4
254
263
255
264
steps :
256
265
- uses : actions/checkout@v2
@@ -266,7 +275,9 @@ jobs:
266
275
echo "$HOME/.local/bin" >> $GITHUB_PATH
267
276
268
277
- name : Install cross-compiler
269
- run : sudo apt install g++-aarch64-linux-gnu
278
+ run : sudo apt install $PACKAGE
279
+ env :
280
+ PACKAGE : ${{ format('g++-{0}', matrix.prefix) }}
270
281
271
282
- name : Download npm package
272
283
uses : actions/download-artifact@v2
@@ -279,14 +290,14 @@ jobs:
279
290
- name : Build standalone release
280
291
run : yarn release:standalone
281
292
282
- - name : Replace node with arm64 equivalent
293
+ - name : Replace node with cross-compile equivalent
283
294
run : |
284
- wget https://nodejs.org/dist/v14.17.0 /node-v14.17.0 -linux-arm64 .tar.xz
285
- tar -xf node-v14.17.0 -linux-arm64 .tar.xz node-v14.17.0 -linux-arm64 /bin/node --strip-components=2
295
+ wget https://nodejs.org/dist/${NODE_VERSION} /node-${NODE_VERSION} -linux-${NPM_CONFIG_ARCH} .tar.xz
296
+ tar -xf node-${NODE_VERSION} -linux-${NPM_CONFIG_ARCH} .tar.xz node-${NODE_VERSION} -linux-${NPM_CONFIG_ARCH} /bin/node --strip-components=2
286
297
mv ./node ./release-standalone/lib/node
287
298
288
299
- name : Build packages with nfpm
289
- run : yarn package arm64
300
+ run : yarn package ${NPM_CONFIG_ARCH}
290
301
291
302
- name : Upload release artifacts
292
303
uses : actions/upload-artifact@v2
0 commit comments