From 9a2fde2cfa7bfb02171234c364b67adccd373729 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Tue, 9 Jun 2026 18:17:26 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=B2=BE=E7=A1=AE=E5=8C=B9=E9=85=8D=20p?= =?UTF-8?q?ackage.json=20=E7=8A=B6=E6=80=81=E8=A1=8C=EF=BC=8C=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=20annotated=20tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/release.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/release.ts b/scripts/release.ts index 8969389..c3915d9 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -104,7 +104,7 @@ async function stepGitCommitTag(version: string): Promise { }); const statusOutput = await new Response(statusProc.stdout).text(); const statusLines = statusOutput.trim().split("\n").filter(Boolean); - const nonPkgChanges = statusLines.filter((line) => !line.includes("package.json")); + const nonPkgChanges = statusLines.filter((line) => !/^[?MADRCU ]{2} package\.json$/.test(line)); if (nonPkgChanges.length > 0) { throw new Error("工作区有其他未提交变更,请先清理后再运行 release"); } @@ -139,9 +139,12 @@ async function stepGitCommitTag(version: string): Promise { } // git tag - const tagProc = Bun.spawn(["git", "tag", `v${version}`], { - stdio: ["inherit", "inherit", "inherit"], - }); + const tagProc = Bun.spawn( + ["git", "tag", "-a", `v${version}`, "-m", `chore: release v${version}`], + { + stdio: ["inherit", "inherit", "inherit"], + }, + ); const tagExit = await tagProc.exited; if (tagExit !== 0) { throw new Error("git tag 失败");