diff options
author | Ben Langfeld <ben@langfeld.me> | 2015-08-11 16:17:47 +0300 |
---|---|---|
committer | Ben Langfeld <ben@langfeld.me> | 2015-08-11 16:17:47 +0300 |
commit | df6c7472d71a86d97d2ae55146d06b624e8e0016 (patch) | |
tree | fea960b958a1ae95be0cc86070ade256c84bee15 | |
parent | ab1d173a2b52c48a56f5d4ddbb1e9b1b08b556a9 (diff) |
Add release pipeline to Grunt
-rw-r--r-- | Gruntfile.js | 44 | ||||
-rw-r--r-- | package.json | 2 |
2 files changed, 45 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 24bd885..4d25157 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -185,6 +185,29 @@ module.exports = function(grunt) { src: ['src/**/*.js'], tests: ['tests/**/*.js'] }, + prompt: { + target: { + options: { + questions: [ + { + config: 'github-release.options.release.body', + type: 'input', + message: 'GitHub release body:' + }, + { + config: 'github-release.options.auth.user', + type: 'input', + message: 'GitHub username:' + }, + { + config: 'github-release.options.auth.password', + type: 'password', + message: 'GitHub password:' + } + ] + } + } + }, compress: { main: { options: { @@ -197,7 +220,19 @@ module.exports = function(grunt) { }, ] } - } + }, + 'github-release': { + options: { + repository: 'candy-chat/candy', + release: { + tag_name: grunt.file.readJSON('package.json').version, + name: grunt.file.readJSON('package.json').version + } + }, + files: { + src: ['candy.zip'] + } + }, }); grunt.loadNpmTasks('grunt-contrib-jshint'); @@ -205,6 +240,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.loadNpmTasks('grunt-github-releaser'); + grunt.loadNpmTasks('grunt-prompt'); grunt.loadNpmTasks('grunt-natural-docs'); grunt.loadNpmTasks('grunt-mkdir'); grunt.loadNpmTasks('grunt-notify'); @@ -221,4 +258,9 @@ module.exports = function(grunt) { 'jshint', 'build', 'notify:default', 'intern:unit' ]); grunt.registerTask('docs', ['mkdir:docs', 'natural_docs', 'notify:docs']); + grunt.registerTask('release', [ + 'prompt', + 'compress', + 'github-release' + ]); }; diff --git a/package.json b/package.json index 43f9d6f..904e884 100644 --- a/package.json +++ b/package.json @@ -47,9 +47,11 @@ "grunt-contrib-uglify": "^0.4.0", "grunt-contrib-watch": "^0.6.1", "grunt-coveralls": "^0.3.0", + "grunt-github-releaser": "^0.1.17", "grunt-mkdir": "^0.1.1", "grunt-natural-docs": "^0.1.1", "grunt-notify": "^0.3.0", + "grunt-prompt": "^1.3.0", "grunt-sync-pkg": "^0.1.2", "grunt-todo": "~0.4.0", "intern": "^2.0.1", |