Skip to content

Commit

Permalink
Use Github Releases for hosting node binaries
Browse files Browse the repository at this point in the history
Replaces S3 hosting of node binaries with Github Releases.
`node-pre-gyp publish` works exclusively with S3, so upload step
is now performed by the Travis deployment provider.

The behaviour for the package user should not change.
When building a new version tag, Travis will create a release for the
tag if it does not already exist.
  • Loading branch information
mjjbell committed May 8, 2021
1 parent 50f5a75 commit 24ad672
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 20 deletions.
41 changes: 26 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,23 +171,23 @@ matrix:
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="10"
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-12"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="12"
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-14"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="14"
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

# Shared Library
- os: linux
Expand Down Expand Up @@ -221,7 +221,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -245,7 +245,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -269,7 +269,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -293,7 +293,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -317,7 +317,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -341,7 +341,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: osx
stage: optional
Expand All @@ -350,7 +350,7 @@ matrix:
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="node"
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -374,7 +374,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -398,15 +398,15 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: osx
osx_image: xcode9.2
compiler: "mason-osx-release-node-lts"
# we use the xcode provides clang and don't install our own
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="--lts"
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -430,7 +430,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

- os: linux
sudo: false
Expand All @@ -454,7 +454,7 @@ matrix:
script:
- npm run nodejs-tests
after_success:
- ./scripts/travis/publish.sh
- ./scripts/travis/node_package.sh

allow_failures:
- compiler: "mason-osx-release-node-latest"
Expand Down Expand Up @@ -572,3 +572,14 @@ script:
- |
- popd
- npm test

deploy:
provider: releases
api_key:
secure: "bSMTxzqgbAcOEszxOvv5FIBmv+BW70IobEHvxe0ShM+ekhLKwKTb5KQRj55ZjpmSEOwqvDr3S1vuqcgXegQvOcLy3HNhxg3aWisexKsbF2oGZdKyjMnyC6jURkXGQUoUoZyCbaOxV1ThJgpcWLjt5qVSR165Az7LxvCrdBer66E="
skip_cleanup: true
file_glob: true
file: build/stage/**/*.tar.gz
on:
tags: true
condition: "$PUBLISH = 'On'"
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased
- Changes from 5.24.0
- Build:
- CHANGED: Node binaries now use Github Releases for hosting [#6030](https://github.com/Project-OSRM/osrm-backend/pull/6030)
- Misc:
- FIXED: Upgrade to @mapbox/node-pre-gyp fix various bugs with Node 12/14 [#5991](https://github.com/Project-OSRM/osrm-backend/pull/5991)
- FIXED: `valid` type in documentation examples [#5990](https://github.com/Project-OSRM/osrm-backend/issues/5990)
Expand Down
3 changes: 2 additions & 1 deletion docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ We may introduce forward-compatible changes: query parameters and response prope
7. Push tags and commits: `git push; git push --tags`
8. On https://github.com/Project-OSRM/osrm-backend/releases press `Draft a new release`,
write the release tag `vx.y.z` in the `Tag version` field, write the changelog entries in the `Describe this release` field
and press `Publish release`.
and press `Publish release`. Note that Travis deployments will create a release when publishing node binaries, so the release
may already exist. In which case the description should be updated with the changelog entries.
9. If not a release-candidate: Write a mailing-list post to [email protected] to announce the release
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
`rm -rf node_modules && npm install` locally.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
"binary": {
"module_name": "node_osrm",
"module_path": "./lib/binding/",
"host": "https://mapbox-node-binary.s3.amazonaws.com",
"remote_path": "./{name}/v{version}/{configuration}/",
"package_name": "{node_abi}-{platform}-{arch}.tar.gz"
"host": "https://github.com",
"remote_path": "./Project-OSRM/osrm-backend/releases/download/v{version}/",
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{configuration}.tar.gz"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if [[ ${PUBLISH} == 'On' ]]; then
fi
fi

./node_modules/.bin/node-pre-gyp package publish info $NPM_FLAGS
./node_modules/.bin/node-pre-gyp package testpackage $NPM_FLAGS
else
echo "PUBLISH is set to '${PUBLISH}', skipping."
fi

0 comments on commit 24ad672

Please sign in to comment.