From 5e2e20015275193b745606d7fb7168884aed8495 Mon Sep 17 00:00:00 2001 From: scarroll Date: Thu, 5 Feb 2015 11:51:32 -0500 Subject: [PATCH] Feature: Add possibilitity to tag release as Github prerelease Reference #104. Closes #106. --- CHANGELOG.md | 1 + tasks/grunt-release.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a853a2..54d2321 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/tasks/grunt-release.js b/tasks/grunt-release.js index ca49e4b..c5edc2d 100644 --- a/tasks/grunt-release.js +++ b/tasks/grunt-release.js @@ -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){