diff --git a/scripts/release-version.ts b/scripts/release-version.ts index b262bb562007..8eea9213699c 100644 --- a/scripts/release-version.ts +++ b/scripts/release-version.ts @@ -104,8 +104,12 @@ export function planReleaseVersion(params: { ); } + const packageVersion = + parsedVersion.correctionNumber === undefined + ? parsedVersion.version + : parsedVersion.baseVersion; const changes = [ - planPackageJson(rootDir, parsedVersion.version), + planPackageJson(rootDir, packageVersion), planMacosInfoPlist(rootDir, parsedVersion), ]; if (params.android) { diff --git a/test/scripts/release-version.test.ts b/test/scripts/release-version.test.ts index cd268853293d..34a53244a704 100644 --- a/test/scripts/release-version.test.ts +++ b/test/scripts/release-version.test.ts @@ -144,6 +144,26 @@ describe("release version planning", () => { }); }); + it("keeps repository versions at the base version for correction tags", () => { + const root = writeFixture(); + const plan = planReleaseVersion({ + rootDir: root, + version: "2026.7.2-3", + }); + applyReleaseVersionPlan(plan); + + expect(plan.version).toBe("2026.7.2-3"); + expect(readJson(path.join(root, "package.json"))).toMatchObject({ + version: "2026.7.2", + }); + expect( + fs.readFileSync( + path.join(root, "apps", "macos", "Sources", "OpenClaw", "Resources", "Info.plist"), + "utf8", + ), + ).toContain("2026.7.2"); + }); + it("keeps an existing Android build increment on the same release train", () => { const root = writeFixture(); const plan = planReleaseVersion({