Update beta process

This commit is contained in:
Louis Lam
2022-03-22 11:30:45 +08:00
parent b0bda9f9d2
commit 76f991ecd8
5 changed files with 396 additions and 408 deletions

View File

@@ -24,9 +24,9 @@ const exists = tagExists(version);
if (! exists) {
// Process package.json
pkg.oldVersion = oldVersion;
pkg.version = version;
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n");
commit(version);
tag(version);
} else {
@@ -34,6 +34,18 @@ if (! exists) {
process.exit(1);
}
function commit(version) {
let msg = "Update to " + version;
let res = child_process.spawnSync("git", ["commit", "-m", msg, "-a"]);
let stdout = res.stdout.toString().trim();
console.log(stdout);
if (stdout.includes("no changes added to commit")) {
throw new Error("commit error");
}
}
function tag(version) {
let res = child_process.spawnSync("git", ["tag", version]);
console.log(res.stdout.toString().trim());