forked from jesusoterogomez/react-notify-toast
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
32 lines (32 loc) · 919 Bytes
/
.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
language: node_js
node_js:
- '4.1'
install:
- npm install
before_script:
- PACKAGE_VERSION=$(npm --loglevel silent run read:version)
- TAG_FOUND=$(if GIT_DIR=$(git show-ref --tags | grep -q "refs/tags/$PACKAGE_VERSION$"); then echo true; else echo false; fi)
- npm run lint
cache:
directories:
- node_modules
deploy:
provider: npm
email: $NPM_EMAIL
api_key: $NPM_API_KEY
skip_cleanup: true
on:
condition: "$TAG_FOUND == false"
branch: master
after_deploy:
if ([ "$TRAVIS_BRANCH" == "master" ] || [ ! -z "$PACKAGE_VERSION" ]) &&
[ "$TRAVIS_PULL_REQUEST" == "false" ]; then
git config --global user.email "[email protected]";
git config --global user.name "Travis CI";
export GIT_TAG=$PACKAGE_VERSION;
git tag $GIT_TAG -a -m "Generated tag from TravisCI build $PACKAGE_VERSION";
git push origin $GIT_TAG;
fi
branches:
except:
- /^(\d+\.)(\d+\.)(\d+)(-\w+)?$/