mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-24 06:29:20 +08:00
Compare commits
1 Commits
release
...
2.0.0-beta
Author | SHA1 | Date | |
---|---|---|---|
|
75f5774d43 |
@@ -24,7 +24,9 @@ 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");
|
||||||
@@ -52,6 +54,19 @@ 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, checkReleaseBranch,
|
execSync, uploadArtifacts,
|
||||||
} from "./lib.mjs";
|
} from "./lib.mjs";
|
||||||
import semver from "semver";
|
import semver from "semver";
|
||||||
|
|
||||||
@@ -23,9 +23,6 @@ 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, checkReleaseBranch
|
pressAnyKey, execSync, uploadArtifacts
|
||||||
} from "./lib.mjs";
|
} from "./lib.mjs";
|
||||||
|
|
||||||
const repoNames = getRepoNames();
|
const repoNames = getRepoNames();
|
||||||
@@ -21,9 +21,6 @@ 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,16 +249,3 @@ 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,7 +28,9 @@ 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");
|
||||||
@@ -52,6 +54,16 @@ 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
|
||||||
|
Reference in New Issue
Block a user