forked from KC3Kai/KC3Kai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
51 lines (47 loc) · 1.53 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
os: linux
dist: trusty
language: node_js
node_js:
- "6"
# travis-ci has enabled npm cache by default since July 2019,
# disable it because it will fail our uglify-harmony patching
cache:
npm: false
before_install:
- npm install -g grunt-cli
- npm install
- patch -N -d node_modules/grunt-contrib-uglify -p2 < misc/uglify-harmony.patch
# BUILD WEBSTORE PACKAGE
before_script:
- npm test
# DEPLOY TO CHROME WEBSTORE
script:
- export KC3_VERSION=$(node -p -e "require('./package.json').version")
- if [ $TRAVIS_BRANCH == 'webstore' ] || [ $TRAVIS_BRANCH == 'release' ]; then grunt build; fi
- if [ $TRAVIS_BRANCH == 'webstore' ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then grunt webstore; fi
- if [ $TRAVIS_BRANCH == 'release' ] && [ $TRAVIS_PULL_REQUEST == "false" ]; then grunt package; fi
# DEPLOY TO GITHUB RELEASES
before_deploy:
- git config --global user.email "[email protected]"
- git config --global user.name "Travis CI"
- git tag $KC3_VERSION -a -m "Automated GitHub release for $KC3_VERSION"
- git push -q https://sinsinpub:[email protected]/sinsinpub/KC3Kai --tags
- cp build/release.zip build/kc3kai-$KC3_VERSION.zip
deploy:
provider: releases
skip_cleanup: true
api_key: $GITHUB_API_KEY
file:
- build/kc3kai-$KC3_VERSION.zip
on:
tags: false
branch: release
condition: $TRAVIS_PULL_REQUEST == "false"
# BUILD NOTIFICATION FOR GITTER
#notifications:
# webhooks:
# urls:
# - https://webhooks.gitter.im/e/e8964a721dd35fd96e46
# on_success: change
# on_failure: change
# on_start: never