From a122e51ea6037d006f47f8086bfcdc5f3988e4e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Fernandes?= Date: Mon, 12 Jun 2017 14:36:30 +0100 Subject: [PATCH 1/2] ci(Travis): Add semantic-release and commitizen --- .travis.yml | 9 +++++++++ package.json | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e6f10f3..d612f54 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: node_js +cache: + directories: + - node_modules node_js: - "7" - "6" @@ -19,9 +22,15 @@ addons: - libudev-dev before_script: +- npm prune - npm install -g gulp - npm install -g istanbul - npm install -g istanbul-coveralls after_success: - npm run cover +- npm run semantic-release + +branches: + only: + - master \ No newline at end of file diff --git a/package.json b/package.json index 0103e40..8b02495 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "main": "avrgirl-arduino.js", "scripts": { "test": "gulp test", - "cover": "istanbul cover ./tests/*.spec.js && istanbul-coveralls" + "cover": "istanbul cover ./tests/*.spec.js && istanbul-coveralls", + "commit": "git-cz", + "semantic-release": "semantic-release pre && npm publish && semantic-release post" }, "repository": { "type": "git", @@ -42,6 +44,8 @@ }, "devDependencies": { "avrga-tester": "1.x", + "commitizen": "2.9.6", + "cz-conventional-changelog": "2.0.0", "gulp": "^3.9.0", "gulp-jscs": "^4.0.0", "gulp-jshint": "^2.0.3", @@ -51,6 +55,7 @@ "jshint": "^2.9.2", "jshint-stylish": "^2.1.0", "proxyquire": "^1.7.3", + "semantic-release": "6.3.6", "sinon": "^2.3.2", "tap-spec": "^4.1.0", "tape": "^4.2.1", @@ -59,5 +64,10 @@ "browser": { "graceful-fs": false, "serialport": "browser-serialport" + }, + "config": { + "commitizen": { + "path": "cz-conventional-changelog" + } } } From 73d463c2548ebaae79b228334b8c00ecdd8ca9ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Fernandes?= Date: Mon, 12 Jun 2017 16:27:55 +0100 Subject: [PATCH 2/2] docs(Contributing): Update commit process --- CONTRIBUTING.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d448d88..5cfdd68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -36,7 +36,9 @@ On average, Arduino boards cost between $15 and $50, depending on the tech inclu 5. Create your patch/feature, including appropriate tests if a test suite is present -6. Commit your changes using a descriptive commit message +6. Once you are ready to commit your changes, follow the commit [convention](https://github.com/conventional-changelog-archived-repos/conventional-changelog-angular/blob/ed32559941719a130bb0327f886d6a32a8cbc2ba/convention.md) through the use of `commitizen`: + 1. `git add ` + 2. `npm run commit` and follow the instruction of the interactive prompt. 7. Rebase on master if your branch falls behind on commits