Skip to content

Commit 82bd20a

Browse files
committed
[ci] Deploy binaries for Linux ARMv6, ARMv7, and ARM64
Fixes #131
1 parent 0e7d979 commit 82bd20a

File tree

2 files changed

+53
-15
lines changed

2 files changed

+53
-15
lines changed

.travis.yml

Lines changed: 48 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,56 @@
11
language: node_js
2-
node_js:
3-
- "14"
4-
- "12"
5-
- "10"
6-
os:
7-
- linux
8-
- osx
2+
jobs:
3+
include:
4+
- os: linux
5+
node_js: 10
6+
env:
7+
- TEST=1
8+
- os: linux
9+
node_js: 12
10+
env:
11+
- TEST=1
12+
- os: linux
13+
node_js: 14
14+
env:
15+
- TEST=1
16+
- BUILD_NAME=linux-x64
17+
- os: osx
18+
node_js: 10
19+
env:
20+
- TEST=1
21+
- os: osx
22+
node_js: 12
23+
env:
24+
- TEST=1
25+
- os: osx
26+
node_js: 14
27+
env:
28+
- TEST=1
29+
- BUILD_NAME=darwin-x64
30+
- os: linux
31+
node_js: 14
32+
env:
33+
- BUILD_NAME=linux-arm
34+
- BUILD_SCRIPT=prebuild-linux-arm
35+
if: tag is present
36+
- os: linux
37+
node_js: 14
38+
arch: arm64
39+
env:
40+
- BUILD_NAME=linux-arm64
41+
if: tag is present
42+
script:
43+
- if [ -n "$TEST" ]; then npm run test; fi
944
before_deploy:
10-
- ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$TRAVIS_OS_NAME-$(uname -m).tar"
11-
- npm run prebuild
12-
- tar --create --verbose --file="$ARCHIVE_NAME" --directory "$TRAVIS_BUILD_DIR/prebuilds" .
45+
- ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$BUILD_NAME.tar"
46+
- if [ -n "$BUILD_SCRIPT" ]; then npm run $BUILD_SCRIPT; else npm run prebuild; fi
47+
- tar -cvf "$ARCHIVE_NAME" -C prebuilds .
1348
deploy:
1449
provider: releases
15-
api_key:
50+
token:
1651
secure: UDF88rp7h735Yi37eAN3voHr5wtkuu1LQPj/8DqkAEBCPW6HSQS0jBVHUFBPIAnLNMzCs94/o3/beujc+x1npjPgFcG82oSTazgMy2SSETUHAYTfsffmlzCtuteadvoLheLF8/D6H+DOOnTrrV3B5DHXscfBTSiPBaUWyC3oKrQ=
17-
file: "$ARCHIVE_NAME"
52+
file: $ARCHIVE_NAME
1853
skip_cleanup: true
1954
on:
2055
tags: true
21-
node: "14"
56+
condition: -n "$BUILD_NAME"

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "index.js",
66
"scripts": {
77
"install": "node-gyp-build",
8-
"prebuild": "prebuildify --napi",
8+
"prebuild": "prebuildify --napi --strip",
9+
"prebuild-linux-arm": "prebuildify-cross -i linux-armv6 -i linux-armv7 --napi --strip",
910
"test": "mocha"
1011
},
1112
"repository": {
@@ -26,6 +27,8 @@
2627
},
2728
"devDependencies": {
2829
"mocha": "^8.0.1",
29-
"prebuildify": "^4.0.0"
30+
"node-gyp": "^7.1.2",
31+
"prebuildify": "^4.0.0",
32+
"prebuildify-cross": "^4.0.0"
3033
}
3134
}

0 commit comments

Comments
 (0)