diff --git a/tasks/publish.js b/tasks/publish.js index 55ea20a71..38039c6d4 100644 --- a/tasks/publish.js +++ b/tasks/publish.js @@ -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