-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
44 lines (44 loc) · 1.6 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
---
sudo: false
language: node_js
cache:
yarn: true
directories:
- node_modules
before_install:
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.12.1
- export PATH="$HOME/.yarn/bin:$PATH"
- export BRANCH="${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}"
- export TZ="America/Sao_Paulo"
- git config remote.origin.fetch '+refs/heads/*:refs/remotes/origin/*'
- git fetch --all
- git checkout "$BRANCH"
install:
- yarn install --frozen-lockfile;
- yarn build
script:
- yarn lint . || travis_terminate 1;
- yarn lint.test . || travis_terminate 1;
- travis_wait yarn coverage
after_success:
- echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > /home/travis/.npmrc
- echo "@crave:registry=https://registry.npmjs.org/" >> /home/travis/.npmrc
- git config user.name "Travis CI" || travis_terminate 1;
- git config user.email "[email protected]" || travis_terminate 1;
- git remote set-url origin https://${GH_TOKEN}@github.com/CraveFood/farmblocks.git || travis_terminate 1;
- |
if [ $BRANCH == "master" ]; then
yarn snyk || travis_terminate 1;
snyk monitor || travis_terminate 1;
lerna publish --yes || travis_terminate 1;
yarn build-storybook || travis_terminate 1;
git add docs;
git commit -m "chore(docs): [ci skip] gallery update";
git push origin "$BRANCH";
source ./bin/github_get_release_id.sh;
./bin/github_publish_release.sh;
else
if [ $TRAVIS_EVENT_TYPE == "push" ]; then
lerna publish --canary --yes --preid "alpha-$BRANCH-$TRAVIS_JOB_NUMBER" || travis_terminate 1;
fi
fi