forked from govuk-react/govuk-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
42 lines (42 loc) · 1.54 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
language: node_js
cache:
yarn: true
directories:
- node_modules
install:
- yarn
- npm install -g codecov
script:
- yarn build:sync
- yarn test
- codecov
# The below codacy command doesn't work for external PRs, and we're happy with Codecov at the moment, so disabling
# - cat ./coverage/lcov.info | codacy-coverage
- yarn build:dist # the dist build is only used to track bundle size delta
- yarn bundlesize
- ./scripts/chromatic.sh
before_deploy:
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc # we only want to run this on deploys as this guarantees we have an NPM_TOKEN env var
# only create releases folder once, before_deploy gets called before every provider so save time by only doing once
- if [ ! -d "releases" ]; then yarn run pack && mkdir releases && mv {components,packages}/*/govuk-react-*.tgz ./releases; fi
- LERNA_VERSION=$(node -e 'console.log(require("./lerna.json").version)')
deploy:
- provider: pages # https://docs.travis-ci.com/user/deployment/pages/
skip-cleanup: true
github-token: $GITHUB_TOKEN # Set in travis-ci.org dashboard, marked secure
keep-history: true
local-dir: packages/storybook/storybook-static
on:
branch: master
- provider: script
skip_cleanup: true
script: lerna exec --no-private --bail=false -- "$TRAVIS_BUILD_DIR/scripts/travisPublish.sh"
on:
tags: true
- provider: releases
api_key: $GITHUB_TOKEN
file_glob: true
file: "releases/govuk-react-*-${LERNA_VERSION}.tgz"
skip_cleanup: true
on:
tags: true