-
Notifications
You must be signed in to change notification settings - Fork 555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: upgrade semantic-release #181
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- "8" | ||
- "6" | ||
- "4" | ||
cache: | ||
directories: | ||
- node_modules | ||
|
@@ -11,26 +15,23 @@ notifications: | |
on_pull_requests: false | ||
rooms: | ||
secure: mWzYwXXkaPJ/t24kG9gz6hYyRGoGX+zsjKDa+IzjhY4NeMJyzgHyN3x1vWwSXhfG1jQuBTFyT5RTWN8Jfo2Za/XDKYfMXXP5gCMtNkeWdflYWaUC7sAZepRANUB3gzkCTvkc/DOY/FI07xCcLMJoZ7jGiADNakTaWvzdExJUBs6NuhGdIUmOT+chbip02yN7mSPeqyU7/vFqpCxxEoPeNzaNshLufbZUEWgmLm0bm5Uxdo7Yi5rL0/nA7oqXUzzWTtgQEu0mOG4Oqu7oXAki2rLISw8enZwt5/fUbxGgK1J3UB86vgnDrxbTAhuNUuddaSxUuDsg1+3xyRzU74cyKUWnWqL10Tyy9KgDR0A+48w2v8DH/pOvnvfXA+FL0zLtDJ9jPuSK0dFbceRYmolEGMDF53Q/s2W+waC13Bi3nHRQJKYmT+bOnoLABLpfm5fbV/2br4LVTQwiP80HJ+19Vy4lriF55zu1yjESUBzdvvX1Dhp5E3AXZZv6xB0v4gyZZeOoIv6BxqinLauZiS3nM7O9vu1QnFvbo4HH0Df651fyy1kOU5UAAD+CNRgpZ8GMc+EegvnLbS3nzbNOPlkACmhxMNcpEvD6MomcB4UV2dPWAYIQSfrRV5h+iZlNSqCkA2pl3p6TTZhLMvoSxziRzUZZx7GQe/cnUGN6GbzyyRk= | ||
matrix: | ||
include: | ||
- node_js: "8" | ||
- node_js: "6" | ||
- node_js: "4" | ||
before_install: | ||
# tests are failing on npm@5, remove this once this is not an issue | ||
- npm i -g npm@^3.0.0 | ||
before_script: | ||
- npm prune | ||
script: | ||
- npm run snyk-auth | ||
# tests are failing on npm@5, downgrade to npm@3 if >3 is installed | ||
- test "$(npm -v | cut -d'.' -f1)" -le 3 || npm i -g npm@^3.0.0 | ||
- npm test | ||
after_success: | ||
- npm run travis-coverage | ||
- python scripts/travis_after_all.py | ||
- export $(cat .to_export_back) | ||
- npm run semantic-release | ||
- bash scripts/travis_after_success.sh | ||
jobs: | ||
include: | ||
- stage: Release | ||
node_js: "8" | ||
script: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Changing this from |
||
# run only if this is a 'push' build | ||
# 1. grab and run semantic-release | ||
# (not used as a dev dep because it pulls in new `npm` and breaks our tests) | ||
# 2. run post-release actions | ||
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then npx semantic-release && bash scripts/travis_after_success.sh; fi' | ||
branches: | ||
except: | ||
- "/^v\\d+\\.\\d+\\.\\d+$/" | ||
- /^released-/ | ||
only: | ||
- "master" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,14 +12,11 @@ | |
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"coverage": "tap --cov --coverage-report=lcov test/*.test.js", | ||
"tap": "COVERALLS_REPO_TOKEN=0 tap --timeout=180 --cov --coverage-report=text-summary test/*.test.js", | ||
"tap": "tap test/*.test.js -R spec --timeout=180", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing |
||
"test": "npm run test-common && npm run tap", | ||
"test-common": "npm run check-tests && npm run lint && node cli/index.js test --org=snyk", | ||
"windows-tests": "tap -R spec test/*.test.js --timeout=120", | ||
"lint": "jscs `find ./cli -name '*.js'` -v && jscs `find ./lib -name '*.js'` -v", | ||
"check-tests": "! grep 'test\\.only' test/*.test.js -n", | ||
"semantic-release": "semantic-release pre && npm publish && semantic-release post", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"snyk-auth": "node cli auth $SNYK_API_KEY", | ||
"snyk-auth-windows": "node cli auth %SNYK_API_KEY%" | ||
}, | ||
|
@@ -70,7 +67,6 @@ | |
"nock": "^9.2.5", | ||
"proxyquire": "^1.7.4", | ||
"restify": "^4.1.1", | ||
"semantic-release": "^8", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"sinon": "^1.17.2", | ||
"strip-ansi": "^4.0.0", | ||
"tap": "^5.7.1", | ||
|
@@ -81,14 +77,6 @@ | |
"type": "git", | ||
"url": "https://github.com/snyk/snyk.git" | ||
}, | ||
"nyc": { | ||
"exclude": [ | ||
"test", | ||
"test{,-*}.js", | ||
"**/*.test.js", | ||
"**/__tests__/**" | ||
] | ||
}, | ||
"pkg": { | ||
"scripts": [ | ||
"cli/**/*.js", | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
#!/bin/bash | ||
|
||
# trigger external services into post-release action | ||
if [ "$TRAVIS_BRANCH" = "master" ]; then | ||
# manually detect master branch push, and post a dockerhub trigger to build the docker images | ||
curl -s -H "Content-Type: application/json" --data "{\"build\": true}" -X POST "https://registry.hub.docker.com/u/snyk/snyk-cli/trigger/${DOCKER_TOKEN}/" | ||
|
@@ -10,3 +11,15 @@ if [ "$TRAVIS_BRANCH" = "master" ]; then | |
curl "https://g.codefresh.io/api/builds/$GRADLE28_BUILD_ID" -H "content-type:application/json; charset=utf-8" -H "x-access-token: $CF_ACCESS_TOKEN" --data-binary "{\"repoOwner\":\"snyk\",\"repoName\":\"snyk\",\"serviceId\":\"$GRADLE28_BUILD_ID\",\"branch\":\"master\",\"type\":\"build\"}" --compressed | ||
curl "https://g.codefresh.io/api/builds/$GRADLE44_BUILD_ID" -H "content-type:application/json; charset=utf-8" -H "x-access-token: $CF_ACCESS_TOKEN" --data-binary "{\"repoOwner\":\"snyk\",\"repoName\":\"snyk\",\"serviceId\":\"$GRADLE44_BUILD_ID\",\"branch\":\"master\",\"type\":\"build\"}" --compressed | ||
fi | ||
|
||
# grab latest version and publish its assets | ||
npm i -g snyk # must install to get the proper `version` key | ||
cd $(dirname $(which snyk))/../lib/node_modules/snyk | ||
|
||
npx pkg . # create standalone binaries based on the latest `pkg` | ||
|
||
export SNYK_VERSION=$(./cli/index.js -v) | ||
|
||
# upload assets built by `pkg` | ||
# GH_TOKEN is set as Travis env var | ||
GITHUB_TOKEN=$GH_TOKEN npx github-release upload --owner snyk --repo snyk --tag "v${SNYK_VERSION}" --name "v${SNYK_VERSION}" ./snyk-linux ./snyk-macos ./snyk-win.exe | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is copied from our internal documentation, please verify correctness :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving nodejs versions to travis (parallel build stages) in order to enable the release job as a separate stage.