From 1ef51cb12c2c00d878b9849aae2f62420c6b45d1 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Sun, 15 Feb 2015 07:54:44 -0700 Subject: [PATCH] [added] Changelog generation from commit messages --- CONTRIBUTING.md | 35 +++++++++++++++++++++++++++++++++++ package.json | 3 ++- tools/release/tasks.js | 10 +++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..c08022dbdf --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contributing + +We welcome community support with both pull requests and reporting bugs. Please +don't hesitate to jump in. + +## Tests + +All commits that fix bugs or add features need a test. + +## Commit Subjects for Public API Changes + +If your patch **changes the API or fixes a bug** please use one of the following +prefixes in your commit subject: + +- `[fixed] ...` +- `[changed] ...` +- `[added] ...` +- `[removed] ...` + +That ensures the subject line of your commit makes it into the auto-generated +changelog. Do not use these tags if your change doesn't fix a bug and doesn't +change the public API. + +### When using `[changed]` or `[removed]`... + +Please include an upgrade path with example code in the commit message. If it +doesn't make sense to do this, then it doesn't make sense to use `[changed]` or +`[removed]` :). For further reading on writing a well formed commit message, +check out these [5 useful tips for a better commit +message](http://robots.thoughtbot.com/5-useful-tips-for-a-better-commit-message) + +## Docs + +Please update the docs with any API changes, the code and docs should always be +in sync. diff --git a/package.json b/package.json index 5028d6746a..025b82214b 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,8 @@ "react-async": "~2.0.0", "react-router-component": "git://github.com/STRML/react-router-component#react-0.12", "requirejs": "~2.1.9", + "rf-changelog": "^0.4.0", "semver": "~2.0.7", "sinon": "^1.10.3" } -} +} \ No newline at end of file diff --git a/tools/release/tasks.js b/tools/release/tasks.js index 35d6ef2e70..d9a3b0535c 100644 --- a/tools/release/tasks.js +++ b/tools/release/tasks.js @@ -56,6 +56,14 @@ module.exports = function(grunt) { next(); }, + // Generate Changelog + function(next) { + execSeries([ + ['node_modules/.bin/changelog', ['-t', 'v' + version]], + ['git', ['add', path.join(repoRoot, 'CHANGELOG.md')]], + ], next); + }, + // Add and commit function(next) { execSeries([ @@ -109,7 +117,7 @@ module.exports = function(grunt) { function(next) { ReleaseRepo(docsRepo, docsRoot, tmpDocsRepo, version, next); - }, + } ], complete); });