Release with build stages

Also update to Node 8, and specify the stable 8 for build/lint/release, rather than latest stable Node, so less stuff changes.
This commit is contained in:
Ray Schamp 2018-06-14 13:40:13 -04:00
parent 2a63b0b027
commit 110c07594d
2 changed files with 19 additions and 25 deletions

View file

@ -1,6 +1,6 @@
language: node_js
node_js:
- 6
- 8
- node
env:
matrix:
@ -12,26 +12,22 @@ script: npm run $NPM_SCRIPT
jobs:
include:
- env: NPM_SCRIPT=build
node_js: node
node_js: 8
if: not (branch in (master, develop) and type != pull_request)
- env: NPM_SCRIPT=lint
node_js: node
after_script:
- |
# RELEASE_BRANCHES and NPM_TOKEN defined in Travis settings panel
declare exitCode
$(npm bin)/travis-after-all
exitCode=$?
if [[
# Execute after all jobs finish successfully
$exitCode = 0 &&
# Only release on release branches
$RELEASE_BRANCHES =~ $TRAVIS_BRANCH &&
# Don't release on PR builds
$TRAVIS_PULL_REQUEST = "false"
]]; then
# Authenticate NPM
echo "//registry.npmjs.org/:_authToken=\${NPM_TOKEN}" > .npmrc
# Set version to timestamp
npm --no-git-tag-version version $($(npm bin)/json -f package.json version)-prerelease.$(date +%s)
npm publish
fi
node_js: 8
- stage: release
node_js: 8
script: skip
before_deploy:
- npm --no-git-tag-version version 0.1.0-prerelease.$(date +%Y%m%d%H%M%S)
deploy:
- provider: npm
on:
all_branches: true
email: $NPM_EMAIL
api_key: $NPM_TOKEN
stages:
- test
- name: release
if: branch in (master, develop) and type != pull_request

View file

@ -34,8 +34,6 @@
"babel-preset-env": "^1.6.1",
"eslint": "^3.19.0",
"eslint-config-scratch": "^3.1.0",
"json": "^9.0.6",
"travis-after-all": "^1.4.4",
"webpack": "^4.8.0",
"webpack-cli": "^2.0.15",
"tap": "^12.0.1"