From b3691e63709919bf9e9283f2969d5adbff5244f7 Mon Sep 17 00:00:00 2001 From: Simon Lydell Date: Thu, 4 Dec 2014 21:43:02 +0100 Subject: [PATCH] Add gulp release task --- CONTRIBUTING.md | 15 +++++++++++++++ gulpfile.coffee | 16 ++++++++++++++++ package.json | 3 +++ 3 files changed, 34 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9d8e7dc..1a582aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -111,3 +111,18 @@ An easy workflow is code, `gulp`, test, repeat. [Node.js]: http://nodejs.org/ [gulp]: https://github.com/gulpjs/gulp [Extension Auto-Installer]: https://addons.mozilla.org/firefox/addon/autoinstaller + +### Making a release + +1. Add a list of changes since the last version at the top of CHANGELOG.md. +2. Update the version in package.json (see above about versioning), and, if + needed, the min and max Firefox versions. +3. Run `gulp release`, which does the following for you: + - Adds a heading with the new version number and today’s date at the top of + CHANGELOG.md. + - Commits CHANGELOG.md and package.json. + - Tags the commit. +4. Run `gulp xpi` to rebuild with the new version number. +5. Push to github. Don’t forget to push the tag! +6. Make a “release” out of the new tag on github, and attach VimFx.xpi to it. +7. Publish on addons.mozilla.org. Add the release notes list as HTML. diff --git a/gulpfile.coffee b/gulpfile.coffee index 54f9e8d..8ffa11b 100644 --- a/gulpfile.coffee +++ b/gulpfile.coffee @@ -24,6 +24,9 @@ gulp = require('gulp') changed = require('gulp-changed') coffee = require('gulp-coffee') coffeelint = require('gulp-coffeelint') +git = require('gulp-git') +header = require('gulp-header') +merge = require('gulp-merge') mustache = require('gulp-mustache') util = require('gulp-util') zip = require('gulp-zip') @@ -106,3 +109,16 @@ gulp.task('lint', -> .pipe(coffeelint()) .pipe(coffeelint.reporter()) ) + +gulp.task('release', -> + { version } = require('./package.json') + message = "VimFx v#{ version }" + today = new Date().toISOString()[...10] + merge( + gulp.src('package.json'), + gulp.src('CHANGELOG.md') + .pipe(header("### #{ version } (#{ today })\n")) + .pipe(gulp.dest('.')) + ).pipe(git.commit(message)) + git.tag(version, message) +) diff --git a/package.json b/package.json index 968acfd..ab8ce6c 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,9 @@ "gulp-changed": "^1.0.0", "gulp-coffee": "^2.2.0", "gulp-coffeelint": "^0.4.0", + "gulp-git": "^0.5.5", + "gulp-header": "^1.2.2", + "gulp-merge": "^0.1.0", "gulp-mustache": "^1.0.0", "gulp-util": "^3.0.1", "gulp-zip": "^2.0.2", -- 2.39.3