forked from OpenCerts/open-certificate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
executable file
·26 lines (26 loc) · 1005 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
language: node_js
node_js:
- lts/*
cache: npm install
script:
- npm run build
- npm run test
- npm run lint
- printf -- "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
- npm config set '//registry.npmjs.org/:_authToken' "${CIVAR_NPM_TOKEN}";
- if [ "${TRAVIS_BRANCH}" = "master" ] && ! [ `printf -- "${TRAVIS_COMMIT_MESSAGE}" | grep "Publish"` ]; then
git checkout ${TRAVIS_BRANCH};
git reset --hard ${TRAVIS_COMMIT};
git remote set-url origin ${CIVAR_GH_REPOSITORY_URL};
npm config set '//registry.npmjs.org/:_authToken' "${CIVAR_NPM_TOKEN}";
if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then
if [ -z "${TRAVIS_COMMIT_MESSAGE##*"[major release]"*}" ]; then
LERNA_CD_VERSION='major';
elif [ -z "${TRAVIS_COMMIT_MESSAGE##*"[minor release]"*}" ]; then
LERNA_CD_VERSION='minor';
else
LERNA_CD_VERSION='patch';
fi;
lerna publish --yes --cd-version ${LERNA_CD_VERSION};
fi;
fi;