This commit is contained in:
Louis Lam 2026-01-13 19:27:34 +08:00
parent 3cf74cda0f
commit fe22e618a2
2 changed files with 7 additions and 5 deletions

View File

@ -23,13 +23,13 @@ if (!exists) {
// Also update package-lock.json
const npm = /^win/.test(process.platform) ? "npm.cmd" : "npm";
const resultVersion = childProcess.spawnSync(npm, ["--no-git-tag-version", "version", version], { shell: true });
const resultVersion = childProcess.spawnSync(npm, ["--no-git-tag-version", "version", version]);
if (resultVersion.error) {
console.error(resultVersion.error);
console.error("error npm version!");
process.exit(1);
}
const resultInstall = childProcess.spawnSync(npm, ["install"], { shell: true });
const resultInstall = childProcess.spawnSync(npm, ["install"]);
if (resultInstall.error) {
console.error(resultInstall.error);
console.error("error update package-lock!");
@ -57,6 +57,11 @@ function commit(version) {
if (stdout.includes("no changes added to commit")) {
throw new Error("commit error");
}
// Git push the branch
childProcess.spawnSync("git", ["push", "origin"]);
stdout = res.stdout.toString().trim();
console.log(stdout);
}
/**

View File

@ -51,9 +51,6 @@ await checkTagExists(repoNames, version);
// node extra/beta/update-version.js
execSync("node ./extra/beta/update-version.js");
// Git push the branch
spawnSync("git", ["push", "origin", branchName], { stdio: "inherit" });
// Create Pull Request (gh pr create will handle pushing the branch)
await createReleasePR(version, previousVersion, dryRun, branchName, githubRunId);