Skip to content

Commit baca7b7

Browse files
mjjbelldanpat
andauthored
Use Github Releases for hosting node binaries (#6030)
* Use Github Releases for hosting node binaries 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. * Switch to the osrm-release-automation machine account rather than personal credentials. Co-authored-by: Daniel Patterson <[email protected]>
1 parent 50f5a75 commit baca7b7

File tree

5 files changed

+34
-20
lines changed

5 files changed

+34
-20
lines changed

.travis.yml

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -171,23 +171,23 @@ matrix:
171171
# we use the xcode provides clang and don't install our own
172172
env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="10"
173173
after_success:
174-
- ./scripts/travis/publish.sh
174+
- ./scripts/travis/node_package.sh
175175

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

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

192192
# Shared Library
193193
- os: linux
@@ -221,7 +221,7 @@ matrix:
221221
script:
222222
- npm run nodejs-tests
223223
after_success:
224-
- ./scripts/travis/publish.sh
224+
- ./scripts/travis/node_package.sh
225225

226226
- os: linux
227227
sudo: false
@@ -245,7 +245,7 @@ matrix:
245245
script:
246246
- npm run nodejs-tests
247247
after_success:
248-
- ./scripts/travis/publish.sh
248+
- ./scripts/travis/node_package.sh
249249

250250
- os: linux
251251
sudo: false
@@ -269,7 +269,7 @@ matrix:
269269
script:
270270
- npm run nodejs-tests
271271
after_success:
272-
- ./scripts/travis/publish.sh
272+
- ./scripts/travis/node_package.sh
273273

274274
- os: linux
275275
sudo: false
@@ -293,7 +293,7 @@ matrix:
293293
script:
294294
- npm run nodejs-tests
295295
after_success:
296-
- ./scripts/travis/publish.sh
296+
- ./scripts/travis/node_package.sh
297297

298298
- os: linux
299299
sudo: false
@@ -317,7 +317,7 @@ matrix:
317317
script:
318318
- npm run nodejs-tests
319319
after_success:
320-
- ./scripts/travis/publish.sh
320+
- ./scripts/travis/node_package.sh
321321

322322
- os: linux
323323
sudo: false
@@ -341,7 +341,7 @@ matrix:
341341
script:
342342
- npm run nodejs-tests
343343
after_success:
344-
- ./scripts/travis/publish.sh
344+
- ./scripts/travis/node_package.sh
345345

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

355355
- os: linux
356356
sudo: false
@@ -374,7 +374,7 @@ matrix:
374374
script:
375375
- npm run nodejs-tests
376376
after_success:
377-
- ./scripts/travis/publish.sh
377+
- ./scripts/travis/node_package.sh
378378

379379
- os: linux
380380
sudo: false
@@ -398,15 +398,15 @@ matrix:
398398
script:
399399
- npm run nodejs-tests
400400
after_success:
401-
- ./scripts/travis/publish.sh
401+
- ./scripts/travis/node_package.sh
402402

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

411411
- os: linux
412412
sudo: false
@@ -430,7 +430,7 @@ matrix:
430430
script:
431431
- npm run nodejs-tests
432432
after_success:
433-
- ./scripts/travis/publish.sh
433+
- ./scripts/travis/node_package.sh
434434

435435
- os: linux
436436
sudo: false
@@ -454,7 +454,7 @@ matrix:
454454
script:
455455
- npm run nodejs-tests
456456
after_success:
457-
- ./scripts/travis/publish.sh
457+
- ./scripts/travis/node_package.sh
458458

459459
allow_failures:
460460
- compiler: "mason-osx-release-node-latest"
@@ -572,3 +572,14 @@ script:
572572
- |
573573
- popd
574574
- npm test
575+
576+
deploy:
577+
provider: releases
578+
api_key:
579+
secure: "Ej7tPd+XhAlBvA0SnYghYakO6QUwUI+oOtjlkPmy0UfKtIQ4bIzoIm1BDbPwrmNiCSKB7lLZYZpKz68PBRtblfqvTjhzXSzlvFk36pyywgkuNY13N3VQZo2c5CShLCy41nx4+uLkjhLfKYOALSE3OivdJJHLZEsSwx60Csx7owU="
580+
skip_cleanup: true
581+
file_glob: true
582+
file: build/stage/**/*.tar.gz
583+
on:
584+
tags: true
585+
condition: "$PUBLISH = 'On'"

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22
- Changes from 5.24.0
3+
- Build:
4+
- CHANGED: Node binaries now use Github Releases for hosting [#6030](https://github.com/Project-OSRM/osrm-backend/pull/6030)
35
- Misc:
46
- FIXED: Upgrade to @mapbox/node-pre-gyp fix various bugs with Node 12/14 [#5991](https://github.com/Project-OSRM/osrm-backend/pull/5991)
57
- FIXED: `valid` type in documentation examples [#5990](https://github.com/Project-OSRM/osrm-backend/issues/5990)

docs/releasing.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ We may introduce forward-compatible changes: query parameters and response prope
5050
7. Push tags and commits: `git push; git push --tags`
5151
8. On https://github.com/Project-OSRM/osrm-backend/releases press `Draft a new release`,
5252
write the release tag `vx.y.z` in the `Tag version` field, write the changelog entries in the `Describe this release` field
53-
and press `Publish release`.
53+
and press `Publish release`. Note that Travis deployments will create a release when publishing node binaries, so the release
54+
may already exist. In which case the description should be updated with the changelog entries.
5455
9. If not a release-candidate: Write a mailing-list post to [email protected] to announce the release
5556
10. Wait until the travis build has been completed and check if the node binaries were published by doing:
5657
`rm -rf node_modules && npm install` locally.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@
6868
"binary": {
6969
"module_name": "node_osrm",
7070
"module_path": "./lib/binding/",
71-
"host": "https://mapbox-node-binary.s3.amazonaws.com",
72-
"remote_path": "./{name}/v{version}/{configuration}/",
73-
"package_name": "{node_abi}-{platform}-{arch}.tar.gz"
71+
"host": "https://github.com",
72+
"remote_path": "./Project-OSRM/osrm-backend/releases/download/v{version}/",
73+
"package_name": "{module_name}-v{version}-{node_abi}-{platform}-{arch}-{configuration}.tar.gz"
7474
}
7575
}

scripts/travis/publish.sh renamed to scripts/travis/node_package.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ if [[ ${PUBLISH} == 'On' ]]; then
3131
fi
3232
fi
3333

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

0 commit comments

Comments
 (0)