Skip to content

Commit 872b29c

Browse files
Merge pull request #736 from watson-developer-cloud/semantic-release
This PR adds `semantic-release` integration to automate SDK releases. With this, the SDK will be released with successful `master` builds (assuming `semantic-release` determines there should be a release - see [here](https://github.com/semantic-release/commit-analyzer#release-rules)). Also added in this PR is `commitlint` to ensure commit messages follow the proper format, since it's necessary for `semantic-release` to work properly. Here's an example of `commitlint` in action: ![bad_commit](https://user-images.githubusercontent.com/8710772/42065334-62a40aae-7b08-11e8-9c42-b9d9709aec4d.gif)
2 parents 46324d9 + 4aa9a81 commit 872b29c

File tree

8 files changed

+916
-11
lines changed

8 files changed

+916
-11
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ or [Stack Overflow](http://stackoverflow.com/questions/ask?tags=ibm-watson).
88
# Code
99

1010
* Our style guide is based on [Google's](https://google.github.io/styleguide/jsguide.html), most of it is automaticaly enforced (and can be automatically applied with `npm run autofix`)
11-
* commits should start with the service name and end with the issue #
12-
```
13-
[concept-insights] Added functionality to list the graphs #135
14-
```
11+
* Commits should follow the [Angular commit message guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#-commit-message-guidelines). This is because our release tool uses this format for determining release versions and generating changelogs. To make this easier, we recommend using the [Commitizen CLI](https://github.com/commitizen/cz-cli) with the `cz-conventional-changelog` adapter.
1512

1613
# Issues
1714

.releaserc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"branch": "master",
3+
"publish": [
4+
"@semantic-release/npm",
5+
{
6+
"path": "@semantic-release/github",
7+
"assets": [
8+
{"path": "dist/watson.js"},
9+
{"path": "dist/watson.min.js"}
10+
]
11+
}
12+
]
13+
}

.travis.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ script:
1717
after_success:
1818
- npm run report-coverage
1919
- scripts/jsdoc/publish.sh
20+
deploy:
21+
- provider: script
22+
skip_cleanup: true
23+
script: npx travis-deploy-once "npx semantic-release"
24+
on:
25+
node: stable

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[![Slack](https://wdc-slack-inviter.mybluemix.net/badge.svg)](https://wdc-slack-inviter.mybluemix.net)
66
[![npm-version](https://img.shields.io/npm/v/watson-developer-cloud.svg)](https://www.npmjs.com/package/watson-developer-cloud)
77
[![npm-downloads](https://img.shields.io/npm/dm/watson-developer-cloud.svg)](https://www.npmjs.com/package/watson-developer-cloud)
8+
[![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)
89

910
Node.js client library to use the Watson APIs.
1011

RELEASE.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
# Release process
22

3-
* Run the tests
4-
* Update the changelog
5-
* Run `npm version major`, `npm version minor`, or `npm version patch`
6-
to increment the version in package.json and create a git commit and tag.
7-
* Run `git push --follow-tags` to push the commit and tag to github.
8-
* Run `npm publish` to publish the changes to npm.
3+
* Make a PR to `master`
4+
* The SDK will be released to npm and GitHub once the PR is merged and the build passes

commitlint.config.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
rules: {
4+
'subject-case': [
5+
2,
6+
'always',
7+
['lower-case', 'sentence-case']
8+
]
9+
}
10+
};

0 commit comments

Comments
 (0)