Skip to content

Commit

Permalink
Add linux-arm64, android-arm and android-arm64 prebuilds (#587)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vweevers authored and ralphtheninja committed Feb 1, 2019
1 parent 77b1e30 commit f1d4c7c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: arm
os: linux
node_js: node
env: [BUILD_CMD=prebuildify-cross-armv7, BUILD_GROUP=arm]
env: [BUILD_CMD=prebuild-arm, BUILD_GROUP=arm]
if: tag is present

script:
Expand All @@ -35,6 +35,7 @@ after_success:
before_deploy:
- export ARCHIVE_NAME="${TRAVIS_TAG:-latest}-$BUILD_GROUP.tar.gz"
- npm run $BUILD_CMD
- file prebuilds/*/*
- tar -zcvf "$ARCHIVE_NAME" -C prebuilds .

deploy:
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
"hallmark": "hallmark --fix",
"dependency-check": "dependency-check . test/*.js bench/*.js",
"prepublishOnly": "npm run dependency-check",
"prebuildify-cross-armv7": "prebuildify-cross --platform=linux --arch=arm --arm-version=7 -- -t 8.14.0 --napi --strip"
"prebuild-arm": "npm run prebuild-linux-armv7 && npm run prebuild-linux-arm64 && npm run prebuild-android-armv7 && npm run prebuild-android-arm64",
"prebuild-linux-armv7": "IMAGE=linux-armv7 ./scripts/cross-compile",
"prebuild-linux-arm64": "IMAGE=linux-arm64 ./scripts/cross-compile",
"prebuild-android-armv7": "IMAGE=android-armv7 ./scripts/cross-compile",
"prebuild-android-arm64": "IMAGE=android-arm64 ./scripts/cross-compile"
},
"dependencies": {
"abstract-leveldown": "~6.0.0",
Expand All @@ -38,7 +42,6 @@
"optimist": "~0.6.1",
"prebuildify": "prebuild/prebuildify#override-platform",
"prebuildify-ci": "^1.0.4",
"prebuildify-cross": "ralphtheninja/prebuildify-cross#TARGET_PLATFORM",
"readfiletree": "~0.0.1",
"rimraf": "^2.6.1",
"slump": "^3.0.0",
Expand Down
7 changes: 7 additions & 0 deletions scripts/cross-compile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash

DOCKER_USER="node"
if [[ "$TRAVIS" == "true" ]]; then DOCKER_USER="travis"; fi

exec docker run -u ${DOCKER_USER} --rm -v $(pwd):/app prebuild/${IMAGE} \
bash -c "npm i --ignore-scripts && npx prebuildify -t 8.14.0 --napi --strip"

0 comments on commit f1d4c7c

Please sign in to comment.