Publish valid semver task independently of the branch
This commit is contained in:
committed by
Nils Knappmeier
parent
fed5818876
commit
7378f854c3
+14
-6
@@ -15,14 +15,22 @@ module.exports = function(grunt) {
|
|||||||
git.commitInfo(function(err, info) {
|
git.commitInfo(function(err, info) {
|
||||||
grunt.log.writeln('tag: ' + info.tagName);
|
grunt.log.writeln('tag: ' + info.tagName);
|
||||||
|
|
||||||
|
var files = [];
|
||||||
|
|
||||||
|
// Publish the master as "latest" and with the commit-id
|
||||||
if (info.isMaster) {
|
if (info.isMaster) {
|
||||||
|
files.push('-latest');
|
||||||
|
files.push('-' + info.head);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Publish tags by their tag-name
|
||||||
|
if (info.tagName && semver.valid(info.tagName)) {
|
||||||
|
files.push('-' + info.tagName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (files.length > 0) {
|
||||||
initSDK();
|
initSDK();
|
||||||
|
grunt.log.writeln('publishing files: ' + JSON.stringify(files));
|
||||||
var files = ['-latest', '-' + info.head];
|
|
||||||
if (info.tagName && semver.valid(info.tagName)) {
|
|
||||||
files.push('-' + info.tagName);
|
|
||||||
}
|
|
||||||
|
|
||||||
publish(fileMap(files), done);
|
publish(fileMap(files), done);
|
||||||
} else {
|
} else {
|
||||||
// Silently ignore for branches
|
// Silently ignore for branches
|
||||||
|
|||||||
Reference in New Issue
Block a user