From 1b69e454d75b766ea0ffee849fd0127c0779fbf3 Mon Sep 17 00:00:00 2001 From: lanyuanxiaoyao Date: Tue, 9 Jun 2026 18:09:52 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=AE=9E=E7=8E=B0=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E9=97=A8=E7=A6=81=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/release.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/release.ts b/scripts/release.ts index 761f215..4884e31 100644 --- a/scripts/release.ts +++ b/scripts/release.ts @@ -86,9 +86,23 @@ async function stepBumpVersion(): Promise { return newVersion; } +async function runTests(): Promise { + console.log("\n运行测试..."); + const proc = Bun.spawn(["bun", "test", "--path-ignore-patterns", "tests/agent/**"], { + stdio: ["inherit", "inherit", "inherit"], + }); + const exitCode = await proc.exited; + if (exitCode !== 0) { + throw new Error(`测试失败 (exit code: ${exitCode}),已跳过 git 和发布步骤`); + } +} + async function main(): Promise { const newVersion = await stepBumpVersion(); console.log(`[1/4] 版本号递增完成: ${newVersion}`); + + await runTests(); + console.log("[2/4] 测试通过"); } main().catch((err: unknown) => {