Simplify Travis CI scripts, fix deploy

This commit is contained in:
Christopher Willis-Ford 2018-01-12 16:35:56 -08:00
parent 8332d706e1
commit c2570133dd

View file

@ -3,8 +3,6 @@ node_js:
- 6
- node
env:
- NPM_SCRIPT="test:unit -- --jobs=4"
- NPM_SCRIPT="test:integration -- --jobs=4"
- NODE_ENV=production
sudo: false
cache:
@ -14,23 +12,24 @@ install:
- npm --production=false install
- npm --production=false update
- npm --production=false prune
script: npm run $NPM_SCRIPT
jobs:
include:
- env: NPM_SCRIPT=test:lint
- stage: test
script:
- npm run test:lint
- npm run test:unit -- --jobs=4
- npm run test:integration -- --jobs=4
- stage: build
script: npm run build
skip_cleanup: true
node_js: 6
- stage: release
node_js: 6
env: NPM_SCRIPT=build
before_deploy:
- if: branch IN (env(RELEASE_BRANCHES))
- npm --no-git-tag-version version $($(npm bin)/json -f package.json version)-prerelease.$(date +%s)
- git config --global user.email $(git log --pretty=format:"%ae" -n1)
- git config --global user.name $(git log --pretty=format:"%an" -n1)
deploy:
- provider: npm
"on":
all_branches: true
condition: $RELEASE_BRANCHES =~ $TRAVIS_BRANCH
skip_cleanup: true
if: branch IN (env(RELEASE_BRANCHES))
provider: npm
email: $NPM_EMAIL
api_key: $NPM_TOKEN