UNPKG

1.26 kBYAMLView Raw
1language: node_js
2cache: npm
3
4# Trigger a push build on master and greenkeeper branches + PRs build on every branches
5# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
6branches:
7 only:
8 - master
9 - /^greenkeeper.*$/
10
11jobs:
12 include:
13 - stage: test
14 node_js: 8
15 - node_js: 10
16 - node_js: lts/*
17 after_script:
18 - npm run coverage:upload
19 - stage: release
20 env: semantic-release
21 node_js: lts/*
22 script: npx semantic-release
23
24 # when Greenkeeper updates @octokit/routes, run "generate-routes" script
25 # and push new routes.json file to the pull request
26 - stage: greenkeeper-routes-update
27 node_js: lts/*
28 script:
29 - git checkout $TRAVIS_BRANCH
30 - node scripts/generate-routes
31 # commit changes and push back to branch on GitHub. If there are no changes then exit without error
32 - 'git commit -a -m "build: routes" --author="Octokit Bot <octokitbot@martynus.net>" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
33 allow_failures:
34
35
36stages:
37 - test
38 - name: release
39 if: branch = master AND type IN (push)
40 - name: greenkeeper-routes-update
41 if: branch =~ ^greenkeeper/@octokit/routes