Skip to content

Commit

Permalink
Publish valid semver task independently of the branch
Browse files Browse the repository at this point in the history
  • Loading branch information
nknapp committed May 12, 2017
1 parent fed5818 commit 7378f85
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions tasks/publish.js
Expand Up @@ -15,14 +15,22 @@ module.exports = function(grunt) {
git.commitInfo(function(err, info) {
grunt.log.writeln('tag: ' + info.tagName);

var files = [];

// Publish the master as "latest" and with the commit-id
if (info.isMaster) {
initSDK();
files.push('-latest');
files.push('-' + info.head);
}

var files = ['-latest', '-' + info.head];
if (info.tagName && semver.valid(info.tagName)) {
files.push('-' + info.tagName);
}
// Publish tags by their tag-name
if (info.tagName && semver.valid(info.tagName)) {
files.push('-' + info.tagName);
}

if (files.length > 0) {
initSDK();
grunt.log.writeln('publishing files: ' + JSON.stringify(files));
publish(fileMap(files), done);
} else {
// Silently ignore for branches
Expand Down

0 comments on commit 7378f85

Please sign in to comment.