/
.travis.yml
32 lines (29 loc) · 1.04 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
language: node_js
cache: npm
# Trigger a push build on master and greenkeeper branches + PRs build on every branches
# Avoid double build on PRs (See https://github.com/travis-ci/travis-ci/issues/1147)
branches:
only:
- master
- /^greenkeeper.*$/
- beta # semantic-release preview releases
- next # semantic-release @next releases
- /^\d+\.x$/ # semantic-release maintenance releases
stages:
- name: release
if: branch =~ /^(\d+\.x|master|next|beta)$/ AND type IN (push)
- name: update-prettier
if: branch =~ ^greenkeeper/prettier
jobs:
include:
- stage: update-prettier
node_js: lts/*
script:
- git checkout $TRAVIS_BRANCH
- npm run format:fix
# commit changes and push back to branch on GitHub. If there are no changes then exit without error
- 'git commit -a -m "style: prettier" && git push "https://${GH_TOKEN}@github.com/$TRAVIS_REPO_SLUG" ${TRAVIS_BRANCH} || true'
- stage: release
node_js: lts/*
env: semantic-release
script: npm run semantic-release