Skip to content

Commit

Permalink
fix(release): gh-pages before SNAPSHOT, and ignore SNAPSHOT
Browse files Browse the repository at this point in the history
  • Loading branch information
Caitlin Potter committed Sep 27, 2013
1 parent ca5a77d commit 49dca37
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
.grunt
/node_modules
/dist
*-SNAPSHOT*
25 changes: 21 additions & 4 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-ngmin');
grunt.loadNpmTasks('grunt-gh-pages');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-clean');

// Project configuration.
grunt.util.linefeed = '\n';

var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
modules: [],
pkg: grunt.file.readJSON('package.json'),
pkg: pkg,
dist: 'dist',
filename: 'ui-comments',
meta: {
Expand Down Expand Up @@ -175,13 +176,15 @@ module.exports = function(grunt) {
// <%= pkg.version is only evaluated once
'release-prepare': [
'grunt before-test after-test',
'grunt clean:dist',
'grunt version', // remove "-SNAPSHOT"
'grunt changelog'
'grunt before-test after-test',
'grunt docgen:%version%',
'grunt changelog',
],
'release-complete': [
'git commit CHANGELOG.md package.json -m "chore(release): v%version%"',
'git tag v%version%',
'grunt gh-pages'
],
'release-start': [
'grunt version:patch:"SNAPSHOT"',
Expand Down Expand Up @@ -234,6 +237,11 @@ module.exports = function(grunt) {
keepalive: true
}
}
},
clean: {
dist: {
src: ['<%= dist %>', 'dist']
}
}
});

Expand Down Expand Up @@ -426,5 +434,14 @@ module.exports = function(grunt) {
grunt.task.run(['concat', 'ngmin', 'uglify', 'ngdocs']);
});

grunt.registerTask('docgen', function() {
var self = this;
if (typeof self.args[0] === 'string') {
console.log(self.args[0]);
grunt.config('pkg.version', self.args[0]);
}
grunt.task.mark().run('gh-pages');
});

return grunt;
};
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"semver": "~2.1.0",
"shelljs": "~0.2.6",
"grunt-gh-pages": "~0.7.4",
"grunt-contrib-connect": "~0.5.0"
"grunt-contrib-connect": "~0.5.0",
"grunt-contrib-clean": "~0.5.0"
}
}

0 comments on commit 49dca37

Please sign in to comment.