[node] Build and publish for node 6.x, 8.x, and 10.x

Note that we're still only testing the 6.x ABI (48).
This commit is contained in:
John Firebaugh
2018-06-15 16:18:33 -07:00
parent ec05ee41d1
commit 37e71666d8
5 changed files with 37 additions and 30 deletions

View File

@@ -24,11 +24,11 @@ workflows:
only: /android-v.*/
branches:
ignore: /.*/
- node6-clang39-release:
- node-clang39-release:
filters:
tags:
only: /node-.*/
- node6-gcc6-debug:
- node-gcc6-debug:
filters:
tags:
only: /node-.*/
@@ -52,7 +52,7 @@ workflows:
ignore: /.*/
- macos-debug
- macos-debug-qt5
- macos-release-node6:
- macos-release-node:
filters:
tags:
only: /node-.*/
@@ -111,7 +111,7 @@ step-library:
- &build-node
run:
name: Build node
command: make node
command: make node-all
- &build-linux
run:
name: Build linux
@@ -158,9 +158,9 @@ step-library:
command: |
brew install cmake ccache
- &install-macos-node6-dependencies
- &install-macos-node-dependencies
run:
name: Install macOS Node@6 dependencies
name: Install macOS Node dependencies
command: |
brew install node@6
brew link node@6 --force --overwrite
@@ -207,7 +207,7 @@ step-library:
run:
name: Publish node package
when: on_success
command: platform/node/scripts/after_success.sh
command: platform/node/scripts/publish.sh
- &upload-render-tests
@@ -516,7 +516,7 @@ jobs:
# ------------------------------------------------------------------------------
node6-clang39-release:
node-clang39-release:
docker:
- image: mbgl/7d2403f42e:linux-clang-3.9
working_directory: /src
@@ -539,7 +539,7 @@ jobs:
- *upload-render-tests
# ------------------------------------------------------------------------------
node6-gcc6-debug:
node-gcc6-debug:
docker:
- image: mbgl/7d2403f42e:linux-gcc-6
resource_class: large
@@ -956,7 +956,7 @@ jobs:
destination: test/fixtures
# ------------------------------------------------------------------------------
macos-release-node6:
macos-release-node:
macos:
xcode: "9.4.0"
environment:
@@ -965,7 +965,7 @@ jobs:
steps:
- checkout
- *install-macos-dependencies
- *install-macos-node6-dependencies
- *install-macos-node-dependencies
- *generate-cache-key
- *restore-cache
- *reset-ccache-stats

View File

@@ -23,7 +23,9 @@ add_node_module(mbgl-node
NAN_VERSION "2.10.0"
# Don't build for Node 4.x, 5.x, 7.x, or 9.x
# See https://nodejs.org/en/download/releases/ for mapping of Node version to ABI number
# See https://nodejs.org/en/download/releases/ for mapping of Node version to ABI number.
# Changes to this property should happen in tandem with updates to the version targets
# in platform/node/scripts/publish.sh and the "node" engines property in package.json.
EXCLUDE_NODE_ABIS 46 47 51 59
)

View File

@@ -14,7 +14,7 @@
"license": "BSD-2-Clause",
"dependencies": {
"@mapbox/cmake-node-module": "^1.1.0",
"node-pre-gyp": "^0.6.37",
"node-pre-gyp": "^0.10.2",
"npm-run-all": "^4.0.2"
},
"devDependencies": {

View File

@@ -1,17 +0,0 @@
#!/bin/bash
set -e
set -o pipefail
PACKAGE_JSON_VERSION=`node -e "console.log(require('./package.json').version)"`
if [[ "${CIRCLE_TAG}" == "node-v${PACKAGE_JSON_VERSION}" ]] || [[ "${PUBLISH:-}" == true ]]; then
if [[ "${BUILDTYPE}" == "RelWithDebInfo" ]]; then
./node_modules/.bin/node-pre-gyp package publish info
elif [[ "${BUILDTYPE}" == "Debug" ]]; then
./node_modules/.bin/node-pre-gyp package publish info --debug
else
echo "error: must provide either Debug or RelWithDebInfo for BUILDTYPE"
exit 1
fi
fi

View File

@@ -0,0 +1,22 @@
#!/bin/bash
set -e
set -o pipefail
PACKAGE_JSON_VERSION=`node -e "console.log(require('./package.json').version)"`
if [[ "${CIRCLE_TAG}" == "node-v${PACKAGE_JSON_VERSION}" ]] || [[ "${PUBLISH:-}" == true ]]; then
# Changes to the version targets here should happen in tandem with updates to the
# EXCLUDE_NODE_ABIS property in cmake/node.cmake and the "node" engines property in
# package.json.
for TARGET in 6.0.0 8.0.0 10.0.0; do
if [[ "${BUILDTYPE}" == "RelWithDebInfo" ]]; then
./node_modules/.bin/node-pre-gyp package publish info --target="${TARGET}"
elif [[ "${BUILDTYPE}" == "Debug" ]]; then
./node_modules/.bin/node-pre-gyp package publish info --target="${TARGET}" --debug
else
echo "error: must provide either Debug or RelWithDebInfo for BUILDTYPE"
exit 1
fi
done
fi