Skip to content
Permalink
Browse files

feat(npm): basic automate npm release support [ci skip]

  • Loading branch information...
sparanoid committed Jun 1, 2016
1 parent a8b60d0 commit ccc952813c434411fcd01305b9f6d07ccd4fbe3a
Showing with 40 additions and 1 deletion.
  1. +37 −1 Gruntfile.js
  2. +3 −0 package.json
@@ -124,8 +124,34 @@ module.exports = function(grunt) {
watch: {
files: ['Gruntfile.js', 'tasks/**/*.js', 'test/**/*.*'],
tasks: ['jshint', 'test']
}
},

conventionalChangelog: {
options: {
changelogOpts: {
preset: 'angular'
}
},
dist: {
src: 'CHANGELOG.md'
}
},

bump: {
options: {
files: ['package.json'],
commitMessage: 'chore: release v%VERSION%',
commitFiles: ['-a'],
tagMessage: 'chore: create tag %VERSION%',
push: false
}
},

'npm-contributors': {
options: {
commitMessage: 'chore: update contributors'
}
}
});

// Actually load this plugin's task(s).
@@ -145,6 +171,16 @@ module.exports = function(grunt) {
'watch'
]);

grunt.registerTask('release', 'bump, changelog and publish to npm.', function(type) {
grunt.task.run([
'npm-contributors',
'bump:' + (type || 'patch') + ':bump-only',
'conventionalChangelog',
'bump-commit',
'npm-publish'
]);
});

// By default, lint and run all tests.
grunt.registerTask('default', [
'clean',
@@ -43,12 +43,15 @@
"devDependencies": {
"chai": "^3.5.0",
"grunt": "^1.0.1",
"grunt-bump": "^0.8.0",
"grunt-contrib-clean": "^1.0.0",
"grunt-contrib-connect": "^1.0.0",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^1.0.0",
"grunt-contrib-jshint": "^1.0.0",
"grunt-contrib-watch": "^1.0.0",
"grunt-conventional-changelog": "^6.1.0",
"grunt-npm": "0.0.2",
"grunt-processhtml": "^0.3.8",
"grunt-simple-mocha": "^0.4.0",
"load-grunt-tasks": "^3.4.0",

0 comments on commit ccc9528

Please sign in to comment.
You can’t perform that action at this time.