-
Notifications
You must be signed in to change notification settings - Fork 27
/
.travis.yml
51 lines (50 loc) · 1.36 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
dist: bionic
git:
depth: false
language: node_js
env:
- COMMITCOUNT="$(git log $(git describe --tags --abbrev=0)..HEAD --oneline|grep -iv 'revert' |grep -e 'fix(' -e 'feat(' -e 'fix:' -e 'feat:' | wc -l | awk '{print $1}')"
cache:
directories:
- ~/.npm
notifications:
email: true
node_js:
- '10'
before_install:
- git log $(git describe --tags --abbrev=0)..HEAD --oneline
- echo $COMMITCOUNT
install:
- make install
jobs:
include:
- script:
- npm run build
before_script: cd packages/server
name: build-server
- script:
- npm run build
- bin/run --version
before_script: cd packages/cli
name: build-cli
- script:
- npm run build
before_script: cd packages/template
name: build-template
- script:
- npm run test
before_script: cd packages/server
name: test-server
- stage: release
if: (type = push AND branch = master)
before_script:
- echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" >> $HOME/.npmrc 2> /dev/null
- git remote add pub https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
- git fetch pub master
- git checkout master
script:
- if [ $COMMITCOUNT != 0 ]; then
echo "########create new release########";
make fake-credentials;
make publish;
fi