add tagging to npm publish to prevent publish racing
This commit is contained in:
@@ -142,7 +142,7 @@ function publish() {
|
||||
|
||||
changedPackages.forEach(function (name) {
|
||||
var loc = getPackageLocation(name);
|
||||
exec("cd " + loc + " && npm publish", true);
|
||||
exec("cd " + loc + " && npm publish --tag prerelease", true);
|
||||
|
||||
// postpublish script
|
||||
var postPub = loc + "/scripts/postpublish.js";
|
||||
@@ -152,7 +152,7 @@ function publish() {
|
||||
}
|
||||
|
||||
var publishedPackages = [];
|
||||
var originalCommit = exec("git rev-list --all --max-count=1");;
|
||||
var originalCommit = exec("git rev-list --all --max-count=1");
|
||||
|
||||
try {
|
||||
publish();
|
||||
@@ -182,5 +182,11 @@ try {
|
||||
return;
|
||||
}
|
||||
|
||||
changedPackages.forEach(function (name) {
|
||||
var loc = getPackageLocation(name);
|
||||
exec("npm dist-tag rm " + name + " prerelease", true);
|
||||
exec("npm dist-tag add " + name + "@" + NEW_VERSION + " stable");
|
||||
});
|
||||
|
||||
exec("git push", true);
|
||||
exec("git push --tags", true);
|
||||
|
||||
Reference in New Issue
Block a user