mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Update gen-publish script to update 'next' tag for main releases
This commit is contained in:
parent
b855438af6
commit
5a012182d9
@ -9,29 +9,36 @@ const LATEST = "2";
|
|||||||
function generateScript() {
|
function generateScript() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const packages = [
|
const packages = [
|
||||||
"node-red-util",
|
"@node-red/util",
|
||||||
"node-red-runtime",
|
"@node-red/runtime",
|
||||||
"node-red-registry",
|
"@node-red/registry",
|
||||||
"node-red-nodes",
|
"@node-red/nodes",
|
||||||
"node-red-editor-client",
|
"@node-red/editor-client",
|
||||||
"node-red-editor-api",
|
"@node-red/editor-api",
|
||||||
"node-red"
|
"node-red"
|
||||||
];
|
];
|
||||||
const rootPackage = require(path.join(__dirname,"..","package.json"));
|
const rootPackage = require(path.join(__dirname,"..","package.json"));
|
||||||
const version = rootPackage.version;
|
const version = rootPackage.version;
|
||||||
|
|
||||||
const versionParts = version.split(".");
|
const versionParts = version.split(".");
|
||||||
|
let updateNextToLatest = false;
|
||||||
let tagArg = "";
|
let tagArg = "";
|
||||||
if (versionParts[0] !== LATEST) {
|
if (versionParts[0] !== LATEST) {
|
||||||
tagArg = `--tag v${versionParts[0]}-maintenance`
|
tagArg = `--tag v${versionParts[0]}-maintenance`
|
||||||
} else if (/-/.test(version)) {
|
} else if (/-/.test(version)) {
|
||||||
tagArg = "--tag next"
|
tagArg = "--tag next"
|
||||||
|
} else {
|
||||||
|
updateNextToLatest = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const lines = [];
|
const lines = [];
|
||||||
|
|
||||||
packages.forEach(name => {
|
packages.forEach(name => {
|
||||||
lines.push(`npm publish ${name}-${version}.tgz ${tagArg}\n`);
|
const tarName = name.replace(/@/,"").replace(/\//,"-")
|
||||||
|
lines.push(`npm publish ${tarName}-${version}.tgz ${tagArg}\n`);
|
||||||
|
if (updateNextToLatest) {
|
||||||
|
lines.push(`npm dist-tag add ${name}@${version} next\n`);
|
||||||
|
}
|
||||||
})
|
})
|
||||||
resolve(lines.join(""))
|
resolve(lines.join(""))
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user