forked from dominique-mueller/angular-notifier
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
73 lines (68 loc) · 1.78 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
# General settings
dist: trusty
sudo: false
language: node_js
node_js:
- "lts/*"
cache: false
notifications:
email: false
branches:
only:
- master
- develop
# Build stages
stages:
- name: build
- name: test
- name: release
if: branch = master
# Build jobs
jobs:
include:
- stage: build
before_install:
- npm install -g npm
install:
- npm ci
script:
- npm run build
- stage: test
before_install:
- npm install -g npm
install:
- npm ci
script:
- npm run test
after_success:
- npm run test:coverage
- stage: release
before_install:
- npm install -g npm
# Clone the whole repository because we also need the develop branch for releasing (Travis only gives us the master by default)
- git clone "https://github.com/$TRAVIS_REPO_SLUG.git" "$TRAVIS_REPO_SLUG";
- cd "$TRAVIS_REPO_SLUG";
- git checkout -qf "$TRAVIS_COMMIT";
# Fix Travis CI issue of detached heads in git
- git checkout master
install:
- npm ci
before_deploy:
# Login to Git to be able to make commits (required by automatic-release)
- git config --global user.name "dominique-mueller";
- git config --global user.email "[email protected]";
- git config credential.helper "store --file=.git/credentials";
- echo "https://$GH_TOKEN:@github.com" > .git/credentials;
# Do release
- npm run release
- npm run build
- npm run release:copy
# Publish the dist folder
- cd dist
deploy:
provider: npm
email: [email protected]
api_key: "$NPM_TOKEN"
skip_cleanup: true
after_deploy:
- cd ..