Skip to content

Commit

Permalink
Feature: Add possibilitity to tag release as Github prerelease
Browse files Browse the repository at this point in the history
Reference #104.
Closes #106.
  • Loading branch information
scarroll authored and drublic committed Feb 22, 2015
1 parent 83ff765 commit 5e2e200
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* Feature: Add possibilitity to tag release as Github prerelease
* Bugfix: Ensure before and after tasks run correctly
(!) Please be sure to use beforeBump, afterBump, beforeRelease and
afterRelease as documented in README.md.
Expand Down
9 changes: 7 additions & 2 deletions tasks/grunt-release.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,19 @@ module.exports = function(grunt){
return;
}

if (!process.env[options.github.usernameVar]) {
grunt.log.warn('Error: No username for GitHub release');
}

request
.post('https://api.github.com/repos/' + options.github.repo + '/releases')
.auth(process.env[options.github.usernameVar], process.env[options.github.passwordVar])
.set('Accept', 'application/vnd.github.manifold-preview')
.set('User-Agent', 'grunt-release')
.send({
"tag_name": tagName,
"name": tagMessage
'tag_name': tagName,
name: tagMessage,
prerelease: type === 'prerelease'
})
.end(function(res){
if (res.statusCode === 201){
Expand Down

0 comments on commit 5e2e200

Please sign in to comment.