Skip to content

Commit

Permalink
Merge pull request #35 from HubSpot/bump-and-tag
Browse files Browse the repository at this point in the history
Update git tag task to version bump
  • Loading branch information
geekjuice committed May 11, 2015
2 parents f9e9f88 + 1a3de4d commit 9f39d89
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 9 deletions.
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Expand Up @@ -34,6 +34,7 @@ to contribute, we ask that you take the following steps:

1. Most of the _editable_ code lives in the `src` directory while built code
will end up in the `dist` directory upon running `npm run build`.

2. Depending on how big your changes are, bump the version numbers appropriately
in `bower.json` and `package.json`. We try to follow semver, so a good rule
of thumb for how to bump the version is:
Expand All @@ -44,9 +45,16 @@ to contribute, we ask that you take the following steps:

Versioning is hard, so just use good judgement and we'll be more than happy
to help out.

__NOTE__: There is a `gulp` task that will automate some of the versioning.
You can run `gulp version:{type}` where type is `patch|minor|major` to
update both `bower.json` and `package.json` as well as add the appropriate
git tag.

3. Provide a thoughtful commit message and push your changes to your fork using
`git push origin master` (assuming your forked project is using `origin` for
the remote name and you are on the `master` branch).

4. Open a Pull Request on GitHub with a description of your changes.


Expand Down
24 changes: 15 additions & 9 deletions gulpfile.js
@@ -1,12 +1,14 @@
var del = require('del');
var gulp = require('gulp');
var babel = require('gulp-babel');
var bump = require('gulp-bump');
var sass = require('gulp-ruby-sass');
var header = require('gulp-header');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var umd = require('gulp-wrap-umd');
var del = require('del');
var gulp = require('gulp');
var babel = require('gulp-babel');
var bump = require('gulp-bump');
var filter = require('gulp-filter');
var sass = require('gulp-ruby-sass');
var header = require('gulp-header');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');
var tagVersion = require('gulp-tag-version');
var umd = require('gulp-wrap-umd');


// Variables
Expand Down Expand Up @@ -70,9 +72,13 @@ gulp.task('css', function() {
var VERSIONS = ['patch', 'minor', 'major'];
for (var i = 0; i < VERSIONS.length; ++i){
(function(version) {
var pkgFilter = filter('package.json');
gulp.task('version:' + version, function() {
gulp.src(['package.json', 'bower.json'])
.pipe(bump({type: version}))
.pipe(pkgFilter)
.pipe(tagVersion())
.pipe(pkgFilter.restore())
.pipe(gulp.dest('.'))
});
})(VERSIONS[i]);
Expand Down
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -20,9 +20,11 @@
"gulp": "^3.8.11",
"gulp-babel": "^5.1.0",
"gulp-bump": "^0.3.0",
"gulp-filter": "^2.0.2",
"gulp-header": "^1.2.2",
"gulp-rename": "^1.2.2",
"gulp-ruby-sass": "^1.0.5",
"gulp-tag-version": "^1.2.1",
"gulp-uglify": "^1.2.0",
"gulp-wrap-umd": "^0.2.1"
},
Expand Down

0 comments on commit 9f39d89

Please sign in to comment.