From 5f6591e1ac398612c25a0b4c146c6fcd81a47a8c Mon Sep 17 00:00:00 2001 From: Stafford Brunk Date: Sun, 22 Jul 2018 12:13:32 -0600 Subject: [PATCH] Prebuild support (#20) * Add prebuild support * Add prebuild-install support * Add repository field to package.json --- .travis.yml | 27 ++++++++++++++++++++++++--- appveyor.yml | 4 ++++ package.json | 10 ++++++++-- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 94b5c97..a1aaac1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,18 @@ sudo: false node_js: - 8 -compiler: clang-3.6 +os: + - linux -env: - - CXX=clang-3.6 +matrix: + include: + - os: osx + env: COMPILER=clang++ + osx_image: xcode9.2 + compiler: clang + - os: linux + env: CXX=clang-3.6 + compiler: clang-3.6 addons: apt: @@ -17,3 +25,16 @@ addons: - ubuntu-toolchain-r-test packages: - clang-3.6 + +branches: + only: + - master + - /^v.*$/ + +deploy: + provider: script + script: npm run prebuild && npm run prebuild:upload -u ${PREBUILD_UPLOAD} + skip_cleanup: true + on: + all_branches: true + tags: true diff --git a/appveyor.yml b/appveyor.yml index b21947b..104bc3d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,6 +5,7 @@ environment: platform: - x64 + - x86 install: - ps: Install-Product node $env:nodejs_version @@ -20,3 +21,6 @@ build: off branches: only: - master + - /^v.*$/ + +deploy_script: IF "%APPVEYOR_REPO_TAG%" == "true" (npm run prebuild && npm run prebuild:upload -u %PREBUILD_UPLOAD%) diff --git a/package.json b/package.json index d847502..cd9542d 100644 --- a/package.json +++ b/package.json @@ -10,14 +10,20 @@ "author": "Max Brunsfeld", "license": "MIT", "dependencies": { - "nan": "^2.10.0" + "nan": "^2.10.0", + "prebuild-install": "^5.0.0" }, "devDependencies": { + "prebuild": "^7.6.1", "tree-sitter-cli": "^0.13.1" }, "scripts": { "build": "tree-sitter generate && node-gyp build", + "install": "prebuild-install || node-gyp rebuild", + "prebuild": "prebuild --all --strip --verbose", + "prebuild:upload": "prebuild --upload-all", "test": "tree-sitter test && script/parse-examples.sh", "test-windows": "tree-sitter test" - } + }, + "repository": "https://github.com/tree-sitter/tree-sitter-bash" }