Repository navigation
Expand file tree
/
Copy path.travis.yml
More file actions
107 lines (93 loc) · 3.54 KB
/
Copy path.travis.yml
File metadata and controls
107 lines (93 loc) · 3.54 KB
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
language: node_js
# never build when commited by the bot
# + prevent double build on dev -> delivery Pull Request
if: sender != "vue-styleguidist-bot" AND sender != "Vue Styleguidist Bot" AND (type = pull_request OR branch = delivery OR branch = next)
cache:
npm: false
directories:
- '~/.pnpm-store'
before_install:
- curl -L https://unpkg.com/@pnpm/self-installer | node
- pnpm config set store-dir ~/.pnpm-store
install:
- pnpm install
# In order to avoid double build on pull requests,
# only build on pushes on delivery and on pushes on pull requests
branches:
only:
- delivery
- next
- dev
stages:
- test
- coverage
- name: documentation
if: type != pull_request AND branch = delivery
- name: release-beta
if: type != pull_request AND branch = next
- name: release
if: type != pull_request AND branch = delivery
- name: merge-back
if: type != pull_request AND branch = delivery
jobs:
include:
- stage: test
script:
- pnpm lint
# Run tests with coverage
- pnpm test:jest -- --runInBand --coverage
# Upload coverage report to Codecov
- curl -s https://codecov.io/bash | bash
# Build & Deploy the documentation website
- stage: documentation
script:
- pnpm docs:build
# Build all examples
- cd examples
- for D in *; do node ../test/styleguidist.js build "${D}" --ci; 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: delivery
- 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 delivery
- git reset --hard
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
- npx lerna version --yes --github-release
- npx 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
- npx lerna version -- --yes --github-release --conventional-prerelease --preid beta
- npx 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 delivery --no-edit
- git branch --set-upstream-to github/dev
- git push