From ed7a8e0be2ec244f01f394a574bc92c8158c2135 Mon Sep 17 00:00:00 2001 From: Benoit Averty Date: Mon, 13 Jun 2016 20:05:26 +0200 Subject: [PATCH] chore(release): Add semantic release to the CI process Travis-CI now runs semantic release at the end of the build process, which will calculate the next version to publish based on conventional commits and publish it to npm. It will also tag the version and generate changelog notes on github. --- .travis.yml | 16 ++++++++++++++-- examples.webpack.config.js | 2 +- package.json | 12 +++++++----- umd-build.webpack.config.js | 2 +- 4 files changed, 23 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9178ac8..e309e88 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,20 @@ +sudo: false language: node_js +cache: + directories: + - node_modules +notifications: + email: false node_js: - - "node" + - '6' + - '5' + - '4' before_script: - npm prune script: - npm run test - - npm run build +after_success: + - npm run semantic-release +branches: + only: + - master diff --git a/examples.webpack.config.js b/examples.webpack.config.js index bc28418..280c9c9 100644 --- a/examples.webpack.config.js +++ b/examples.webpack.config.js @@ -1,4 +1,4 @@ -const { join } = require('path'); +const join = require('path').join; module.exports = { entry: { diff --git a/package.json b/package.json index e509aab..1e0f74e 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "reactive-goban", - "version": "0.1.1", + "version": "0.0.0-semantic-release", "description": "A Javascript representation of a Go game and a React component able to render it", - "main": "./dist/index.js", + "main": "./lib/index.js", "directories": { "test": "test" }, @@ -16,11 +16,12 @@ "build:umd": "webpack --config umd-build.webpack.config.js --output-filename reactive-goban.js", "build:umd.min": "webpack -p --config umd-build.webpack.config.js --output-filename reactive-goban.min.js", "prepublish": "in-install || npm run build", - "clean": "rimraf dist lib" + "clean": "rimraf dist lib", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "repository": { "type": "git", - "url": "git+https://github.com/BenoitAverty/reactive-goban.git" + "url": "https://github.com/BenoitAverty/reactive-goban.git" }, "keywords": [ "Go", @@ -58,7 +59,8 @@ "npm-run-all": "^2.1.2", "rimraf": "^2.5.2", "webpack": "^1.13.1", - "webpack-dev-server": "^1.14.1" + "webpack-dev-server": "^1.14.1", + "semantic-release": "^4.3.5" }, "dependencies": { "@cycle/dom": "^9.4.0", diff --git a/umd-build.webpack.config.js b/umd-build.webpack.config.js index 2e0887d..4d63374 100644 --- a/umd-build.webpack.config.js +++ b/umd-build.webpack.config.js @@ -1,4 +1,4 @@ -const { join } = require('path'); +const join = require('path').join; module.exports = { entry: './src/index.js',