-
Notifications
You must be signed in to change notification settings - Fork 10
/
.travis.yml
81 lines (65 loc) · 1.61 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
sudo: required
dist: trusty
addons:
chrome: stable
language: node_js
node_js:
- node
branches:
only:
- master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
- /^greenkeeper/.*$/
before_install:
- "[[ $(node -v) =~ ^v9.*$ ]] || npm install -g npm@latest"
- npm install -g --silent greenkeeper-lockfile@1
- npm install -g --silent karma
install:
- npm install
- npm install -g --silent gh-pages
before_script:
- sudo chown root /opt/google/chrome/chrome-sandbox
- sudo chmod 4755 /opt/google/chrome/chrome-sandbox
- greenkeeper-lockfile-update
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- sleep 3
script:
- npm run test
after_success:
- greenkeeper-lockfile-upload
- npm run coveralls
- npm run build site
- test $TRAVIS_BRANCH = "master" && test $TRAVIS_PULL_REQUEST = "false" &&
cp demos/site/index.html dist/index.html &&
sed -i 's/site.umd.js/\/custom-elements-ts\/site.umd.js/g' dist/index.html &&
gh-pages -d dist --repo=https://$GH_TOKEN@github.com/geocine/custom-elements-ts.git
before_deploy:
- |
function npm_dist_tag() {
if [[ "$TRAVIS_TAG" = *"-"* ]]; then
echo "next"
else
echo "latest"
fi
}
- npm run bundle && cd dist
deploy:
provider: npm
email: geocipher@gmail.com
skip_cleanup: true
tag: $(npm_dist_tag)
api_key:
secure: $NPM_TOKEN
on:
all_branches: true
tags: true
repo: geocine/custom-elements-ts
after_deploy: |
if [ "$(npm_dist_tag)" == "latest" ]; then
npm dist-tag rm custom-elements-ts next || true
fi
notifications:
email:
on_failure: change
on_success: never