forked from vue-styleguidist/vue-styleguidist
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
111 lines (96 loc) · 3.63 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
language: node_js
# never build when commited by the bot
# + prevent double build on dev -> master Pull Request
if: sender != "vue-styleguidist-bot" AND sender != "Vue Styleguidist Bot" AND (type = pull_request OR branch = master OR branch = next)
cache: yarn
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.13.0
- export PATH="$HOME/.yarn/bin:$PATH"
install:
- yarn install
# In order to avoid double build on pull requests,
# only build on pushes on master and on pushes on pull requests
branches:
only:
- master
- next
- dev
stages:
- test
- coverage
- name: documentation
if: type != pull_request AND branch = master
- name: release-beta
if: type != pull_request AND branch = next
- name: release
if: type != pull_request AND branch = master
- name: merge-back
if: type != pull_request AND branch = master
jobs:
include:
- stage: test
script:
- yarn lint
# Run tests without coverage since it's 2x faster
- yarn test:jest --runInBand
- yarn danger ci
- stage: coverage
script:
- yarn lint
# Run tests with coverage
- yarn test:jest --runInBand --coverage
# Upload coverage report to Codecov
- curl -s https://codecov.io/bash | bash
# Build & Deploy the documentation website
- stage: documentation
script:
- yarn docs:build
# Build all examples
- cd examples
- for D in *; do yarn build "${D}"; done || exit 1
# Move them to the docs
- for D in *; do mv "${D}"/dist ../docs/dist/"${D}"; done || exit 1
deploy:
provider: pages
skip-cleanup: true
local-dir: docs/dist
target-branch: master
repo: vue-styleguidist/vue-styleguidist.github.io
github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable
keep-history: true
on:
branch: master
- stage: release
script:
- git config --global user.name "Vue Styleguidist Bot"
- git config --global user.email "${BOT_EMAIL}"
- git remote set-url origin "https://${GH_TOKEN}@github.com/vue-styleguidist/vue-styleguidist.git" > /dev/null 2>&1
- git checkout master
- git reset --hard
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
- yarn lerna version --yes --github-release
- yarn lerna publish from-git --yes
- stage: release-beta
script:
- git config --global user.name "Vue Styleguidist Bot"
- git config --global user.email "${BOT_EMAIL}"
- git remote set-url origin "https://${GH_TOKEN}@github.com/vue-styleguidist/vue-styleguidist.git" > /dev/null 2>&1
- git checkout next
- git reset --hard
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
- yarn lerna version --yes --github-release --conventional-prerelease --preid beta
- yarn lerna publish from-git --yes --dist-tag next
# then merge the whole thing back to dev
- stage: merge-back
install: skip # bundle install is not required
script:
- git config --global user.name "Vue Styleguidist Bot"
- git config --global user.email "${BOT_EMAIL}"
- git remote add github "https://${GH_TOKEN}@github.com/vue-styleguidist/vue-styleguidist.git" > /dev/null 2>&1
- git fetch github dev
- git checkout github/dev
- git checkout -b dev
- git status -v
- git merge master --no-edit
- git branch --set-upstream-to github/dev
- git push