mirror of https://github.com/louislam/uptime-kuma
Release 2.0.0-beta.4 (#6104)
parent
0e30c43a80
commit
c6048d56b4
|
@ -24,9 +24,7 @@ if (! exists) {
|
||||||
// Also update package-lock.json
|
// Also update package-lock.json
|
||||||
const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm";
|
const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm";
|
||||||
childProcess.spawnSync(npm, [ "install" ]);
|
childProcess.spawnSync(npm, [ "install" ]);
|
||||||
|
|
||||||
commit(version);
|
commit(version);
|
||||||
tag(version);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log("version tag exists, please delete the tag or use another tag");
|
console.log("version tag exists, please delete the tag or use another tag");
|
||||||
|
@ -54,19 +52,6 @@ function commit(version) {
|
||||||
console.log(res.stdout.toString().trim());
|
console.log(res.stdout.toString().trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a tag with the specified version
|
|
||||||
* @param {string} version Tag to create
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
function tag(version) {
|
|
||||||
let res = childProcess.spawnSync("git", [ "tag", version ]);
|
|
||||||
console.log(res.stdout.toString().trim());
|
|
||||||
|
|
||||||
res = childProcess.spawnSync("git", [ "push", "origin", version ]);
|
|
||||||
console.log(res.stdout.toString().trim());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a tag exists for the specified version
|
* Check if a tag exists for the specified version
|
||||||
* @param {string} version Version to check
|
* @param {string} version Version to check
|
||||||
|
|
|
@ -8,7 +8,7 @@ import {
|
||||||
checkVersionFormat,
|
checkVersionFormat,
|
||||||
getRepoNames,
|
getRepoNames,
|
||||||
pressAnyKey,
|
pressAnyKey,
|
||||||
execSync, uploadArtifacts,
|
execSync, uploadArtifacts, checkReleaseBranch,
|
||||||
} from "./lib.mjs";
|
} from "./lib.mjs";
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
|
|
||||||
|
@ -23,6 +23,9 @@ if (!githubToken) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the current branch is "release"
|
||||||
|
checkReleaseBranch();
|
||||||
|
|
||||||
// Check if the version is a valid semver
|
// Check if the version is a valid semver
|
||||||
checkVersionFormat(version);
|
checkVersionFormat(version);
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import {
|
||||||
checkTagExists,
|
checkTagExists,
|
||||||
checkVersionFormat,
|
checkVersionFormat,
|
||||||
getRepoNames,
|
getRepoNames,
|
||||||
pressAnyKey, execSync, uploadArtifacts
|
pressAnyKey, execSync, uploadArtifacts, checkReleaseBranch
|
||||||
} from "./lib.mjs";
|
} from "./lib.mjs";
|
||||||
|
|
||||||
const repoNames = getRepoNames();
|
const repoNames = getRepoNames();
|
||||||
|
@ -21,6 +21,9 @@ if (!githubToken) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the current branch is "release"
|
||||||
|
checkReleaseBranch();
|
||||||
|
|
||||||
// Check if the version is a valid semver
|
// Check if the version is a valid semver
|
||||||
checkVersionFormat(version);
|
checkVersionFormat(version);
|
||||||
|
|
||||||
|
|
|
@ -249,3 +249,16 @@ export function execSync(cmd) {
|
||||||
console.info(`[DRY RUN] ${cmd}`);
|
console.info(`[DRY RUN] ${cmd}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the current branch is "release"
|
||||||
|
* @returns {void}
|
||||||
|
*/
|
||||||
|
export function checkReleaseBranch() {
|
||||||
|
const res = childProcess.spawnSync("git", [ "rev-parse", "--abbrev-ref", "HEAD" ]);
|
||||||
|
const branch = res.stdout.toString().trim();
|
||||||
|
if (branch !== "release") {
|
||||||
|
console.error(`Current branch is ${branch}, please switch to "release" branch`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -28,9 +28,7 @@ if (! exists) {
|
||||||
// Also update package-lock.json
|
// Also update package-lock.json
|
||||||
const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm";
|
const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm";
|
||||||
childProcess.spawnSync(npm, [ "install" ]);
|
childProcess.spawnSync(npm, [ "install" ]);
|
||||||
|
|
||||||
commit(newVersion);
|
commit(newVersion);
|
||||||
tag(newVersion);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log("version exists");
|
console.log("version exists");
|
||||||
|
@ -54,16 +52,6 @@ function commit(version) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a tag with the specified version
|
|
||||||
* @param {string} version Tag to create
|
|
||||||
* @returns {void}
|
|
||||||
*/
|
|
||||||
function tag(version) {
|
|
||||||
let res = childProcess.spawnSync("git", [ "tag", version ]);
|
|
||||||
console.log(res.stdout.toString().trim());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a tag exists for the specified version
|
* Check if a tag exists for the specified version
|
||||||
* @param {string} version Version to check
|
* @param {string} version Version to check
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "uptime-kuma",
|
"name": "uptime-kuma",
|
||||||
"version": "2.0.0-beta.3",
|
"version": "2.0.0-beta.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|
Loading…
Reference in New Issue