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

@ -1,16 +0,0 @@
const pkg = require("../../package.json");
const fs = require("fs");
const util = require("../../src/util");
util.polyfill();
const oldVersion = pkg.oldVersion;
if (!oldVersion) {
console.log("Error: no old version?");
process.exit(1);
}
delete pkg.oldVersion;
pkg.version = oldVersion;
fs.writeFileSync("package.json", JSON.stringify(pkg, null, 4) + "\n");

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());

View file

@ -38,7 +38,7 @@ if (! exists) {
}
function commit(version) {
let msg = "update to " + version;
let msg = "Update to " + version;
let res = child_process.spawnSync("git", ["commit", "-m", msg, "-a"]);
let stdout = res.stdout.toString().trim();

767
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -52,9 +52,8 @@
"update-language-files-with-base-lang": "cd extra/update-language-files && node index.js %npm_config_base_lang% && eslint ../../src/languages/**.js --fix",
"update-language-files": "cd extra/update-language-files && node index.js && eslint ../../src/languages/**.js --fix",
"ncu-patch": "npm-check-updates -u -t patch",
"release-beta": "node extra/beta/update-version.js && npm run build && node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:$VERSION -t louislam/uptime-kuma:beta . --target release --push && node ./extra/press-any-key.js && npm run upload-artifacts && npm run reset-version",
"git-remove-tag": "git tag -d",
"reset-version": "node extra/beta/reset-version.js"
"release-beta": "node extra/beta/update-version.js && npm run build && node ./extra/env2arg.js docker buildx build -f docker/dockerfile --platform linux/amd64,linux/arm64,linux/arm/v7 -t louislam/uptime-kuma:$VERSION -t louislam/uptime-kuma:beta . --target release --push && node ./extra/press-any-key.js && npm run upload-artifacts",
"git-remove-tag": "git tag -d"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "~1.2.36",