Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit f1d4c7c

Browse files
vweeversLars-Magnus Skog
authored andcommitted
Add linux-arm64, android-arm and android-arm64 prebuilds (#587)
* Add linux-arm64, android-arm and android-arm64 prebuilds * 5.0.0-2-arm * Disable package-lock.json * Disable android for now * Use plain docker for linux and armv7/arm64 * Print out file type after build * 5.0.0-2-docker * Print out users and groups * Print out environment * Only do linux-armv7 for now * Run docker with user travis on Travis * 5.0.0-2-docker2 * Revert "Only do linux-armv7 for now" This reverts commit 92bb36e. * Clean up * Update arm64 script * 5.0.0-2-docker3 * Add back android armv7 * 5.0.0-2-docker4 * Add back android arm64 * 5.0.0-2-docker5 * Actually run prebuild-android-arm64 * 5.0.0-2-docker6 * Refactor into cross-compile script + remove prebuildify-cross dependency * Revert temporary version * Remove -it
1 parent 77b1e30 commit f1d4c7c

4 files changed

Lines changed: 15 additions & 3 deletions

File tree

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: arm
2424
os: linux
2525
node_js: node
26-
env: [BUILD_CMD=prebuildify-cross-armv7, BUILD_GROUP=arm]
26+
env: [BUILD_CMD=prebuild-arm, BUILD_GROUP=arm]
2727
if: tag is present
2828

2929
script:
@@ -35,6 +35,7 @@ after_success:
3535
before_deploy:
3636
- export ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$BUILD_GROUP.tar.gz"
3737
- npm run $BUILD_CMD
38+
- file prebuilds/*/*
3839
- tar -zcvf "$ARCHIVE_NAME" -C prebuilds .
3940

4041
deploy:

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@
1414
"hallmark": "hallmark --fix",
1515
"dependency-check": "dependency-check . test/*.js bench/*.js",
1616
"prepublishOnly": "npm run dependency-check",
17-
"prebuildify-cross-armv7": "prebuildify-cross --platform=linux --arch=arm --arm-version=7 -- -t 8.14.0 --napi --strip"
17+
"prebuild-arm": "npm run prebuild-linux-armv7 && npm run prebuild-linux-arm64 && npm run prebuild-android-armv7 && npm run prebuild-android-arm64",
18+
"prebuild-linux-armv7": "IMAGE=linux-armv7 ./scripts/cross-compile",
19+
"prebuild-linux-arm64": "IMAGE=linux-arm64 ./scripts/cross-compile",
20+
"prebuild-android-armv7": "IMAGE=android-armv7 ./scripts/cross-compile",
21+
"prebuild-android-arm64": "IMAGE=android-arm64 ./scripts/cross-compile"
1822
},
1923
"dependencies": {
2024
"abstract-leveldown": "~6.0.0",
@@ -38,7 +42,6 @@
3842
"optimist": "~0.6.1",
3943
"prebuildify": "prebuild/prebuildify#override-platform",
4044
"prebuildify-ci": "^1.0.4",
41-
"prebuildify-cross": "ralphtheninja/prebuildify-cross#TARGET_PLATFORM",
4245
"readfiletree": "~0.0.1",
4346
"rimraf": "^2.6.1",
4447
"slump": "^3.0.0",

scripts/cross-compile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
DOCKER_USER="node"
4+
if [[ "$TRAVIS" == "true" ]]; then DOCKER_USER="travis"; fi
5+
6+
exec docker run -u ${DOCKER_USER} --rm -v $(pwd):/app prebuild/${IMAGE} \
7+
bash -c "npm i --ignore-scripts && npx prebuildify -t 8.14.0 --napi --strip"

0 commit comments

Comments
 (0)