diff --git a/.travis.yml b/.travis.yml index 6561d46..173c876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,17 @@ +language: node_js cache: directories: - "node_modules" -language: node_js +notifications: + email: false node_js: - 'node' script: - npx jest --coverage - - npx danger ci \ No newline at end of file + - npx danger ci + +after_success: +- npm run travis-deploy-once "npm run semantic-release" +branches: + except: + - /^v\d+\.\d+\.\d+$/ diff --git a/AUTHORS.txt b/AUTHORS.txt index f69c725..6798307 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -1,3 +1,5 @@ # Authors ordered by first contribution Stefan Staude - https://github.com/staust +Vitaly Ivanov - https://github.com/viviivanov +Daniel Große - https://github.com/Ninerian \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 591a2cb..4befd34 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -# plugins-client-sdk [![Build Status](https://travis-ci.org/Staffbase/plugins-client-sdk.svg?branch=master)](https://travis-ci.org/Staffbase/plugins-client-sdk) +# plugins-client-sdk +[![Build Status](https://travis-ci.org/Staffbase/plugins-client-sdk.svg?branch=master)](https://travis-ci.org/Staffbase/plugins-client-sdk) +[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) +[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/) + If you are developing your own plugin for your Staffbase app you may want your plugin to communicate with our clients. In order to make this possible we implemented a Javascript based API and communication layer for all our apps. We want to provide a library to help you improve your plugin functionality. @@ -28,7 +32,9 @@ TODO - Fork it - Create a branch `git checkout -b feature-description` - Put your name into AUTHORS.txt -- Commit your changes `git commit -am "Added ...."` +- Commit your changes + - As this repository is commitizen friendly you may use `npx git-cz` to create a commit + - Your commit message is validated with a husky managed githook - Push to the branch `git push origin feature-description` - Open a Pull Request diff --git a/package.json b/package.json index 17534ad..8c96c9f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@staffbase/plugins-client-sdk", - "version": "0.4.0", + "version": "0.0.0-semantically-released", "description": "Staffbase plugins client SDK for JavaScript", "main": "dist/plugins-client-sdk.js", "module": "dist/plugins-client-sdk.esm.js", @@ -14,11 +14,14 @@ "lint": "npm run lint-code && npm run lint-size", "lint-code": "npx eslint src test", "lint-size": "npx size-limit", - "fix": "eslint --fix 'src/**/*.js' 'test/**/*.js'" + "fix": "eslint --fix 'src/**/*.js' 'test/**/*.js'", + "travis-deploy-once": "travis-deploy-once", + "semantic-release": "semantic-release", + "commitmsg": "validate-commit-msg" }, "repository": { "type": "git", - "url": "git+https://github.com/Staffbase/plugins-client-sdk.git" + "url": "https://github.com/Staffbase/plugins-client-sdk.git" }, "keywords": [ "staffbase", @@ -43,6 +46,25 @@ "url": "https://github.com/Staffbase/plugins-client-sdk/issues" }, "homepage": "https://github.com/Staffbase/plugins-client-sdk#readme", + "release": { + "branch": "master", + "verifyConditions": [ + "@semantic-release/changelog", + { + "path": "@semantic-release/npm", + "npmPublish": false + }, + "@semantic-release/git", + "@semantic-release/github" + ], + "prepare": [ + "@semantic-release/changelog", + "@semantic-release/git" + ], + "publish": [ + "@semantic-release/github" + ] + }, "directories": { "test": "test" }, @@ -59,6 +81,8 @@ "loglevel": "^1.6.1" }, "devDependencies": { + "@semantic-release/changelog": "^3.0.0", + "@semantic-release/git": "^7.0.3", "@babel/core": "^7.0.0", "@babel/plugin-external-helpers": "^7.0.0", "@babel/plugin-transform-runtime": "^7.0.0", @@ -67,13 +91,16 @@ "@babel/runtime": "^7.0.0", "babel-core": "^7.0.0-bridge.0", "babel-jest": "23.4.2", + "commitizen": "^2.10.1", "compare-versions": "^3.3.1", + "cz-conventional-changelog": "^2.1.0", "danger": "3.8.6", "danger-plugin-istanbul-coverage": "1.6.0", "eslint": "^5.4.0", "eslint-config-google": "^0.9.1", "eslint-config-prettier": "^3.0.1", "eslint-plugin-prettier": "^2.6.2", + "husky": "^0.14.3", "jest": "23.5.0", "jest-extended": "0.8.1", "prettier": "^1.14.2", @@ -86,6 +113,14 @@ "rollup-plugin-node-resolve": "^3.3.0", "rollup-plugin-strip-logger": "0.4.1", "rollup-plugin-uglify": "4.0.0", - "size-limit": "^0.19.2" + "semantic-release": "^15.9.12", + "size-limit": "^0.19.2", + "travis-deploy-once": "^5.0.4", + "validate-commit-msg": "^2.14.0" + }, + "config": { + "commitizen": { + "path": "./node_modules/cz-conventional-changelog" + } } }