Skip to content

Commit 93ce4e8

Browse files
Use next patch version for nightly releases
- Bump nightly metadata generation and smoke tests - Document the new nightly base version rule
1 parent 651401d commit 93ce4e8

4 files changed

Lines changed: 28 additions & 10 deletions

File tree

‎docs/release.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ This document covers the unified release workflow for stable and nightly desktop
3737
- tag format: `nightly-vX.Y.Z-nightly.YYYYMMDD.<run_number>`
3838
- release name includes the short commit SHA
3939
- `make_latest` is always `false`
40-
- Uses the current `apps/desktop/package.json` semver core (`X.Y.Z`) as the nightly base, then appends a nightly prerelease suffix.
40+
- Uses the next stable patch version as the nightly base. For example, `0.0.17` produces nightlies on `0.0.18-nightly.*`.
4141
- Publishes Electron auto-update metadata to the dedicated `nightly` updater channel, so desktop users can opt into that track independently from stable.
4242
- Publishes the CLI package (`apps/server`, npm package `t3`) to the `nightly` npm dist-tag using the same nightly version.
4343
- Does not commit version bumps back to `main`.

‎scripts/release-smoke.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,17 @@ try {
127127
);
128128
assertContains(
129129
nightlyReleaseMetadata,
130-
"version=9.9.9-nightly.20260413.321",
130+
"version=9.9.10-nightly.20260413.321",
131131
"Expected nightly metadata to contain the derived nightly version.",
132132
);
133133
assertContains(
134134
nightlyReleaseMetadata,
135-
"tag=nightly-v9.9.9-nightly.20260413.321",
135+
"tag=nightly-v9.9.10-nightly.20260413.321",
136136
"Expected nightly metadata to contain the derived nightly tag.",
137137
);
138138
assertContains(
139139
nightlyReleaseMetadata,
140-
"name=T3 Code Nightly 9.9.9-nightly.20260413.321 (abcdef123456)",
140+
"name=T3 Code Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
141141
"Expected nightly metadata to include the short commit SHA in the release name.",
142142
);
143143

‎scripts/resolve-nightly-release.test.ts‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { assert, it } from "@effect/vitest";
33
import {
44
resolveNightlyBaseVersion,
55
resolveNightlyReleaseMetadata,
6+
resolveNightlyTargetVersion,
67
} from "./resolve-nightly-release.ts";
78

89
it("strips prerelease and build metadata when deriving the nightly base version", () => {
@@ -11,14 +12,20 @@ it("strips prerelease and build metadata when deriving the nightly base version"
1112
assert.equal(resolveNightlyBaseVersion("1.2.3-beta.4+build.9"), "1.2.3");
1213
});
1314

15+
it("bumps the patch version before deriving nightly prerelease versions", () => {
16+
assert.equal(resolveNightlyTargetVersion("0.0.17"), "0.0.18");
17+
assert.equal(resolveNightlyTargetVersion("9.9.9-smoke.0"), "9.9.10");
18+
assert.equal(resolveNightlyTargetVersion("1.2.3-beta.4+build.9"), "1.2.4");
19+
});
20+
1421
it("derives nightly metadata including the short commit sha in the release name", () => {
1522
assert.deepStrictEqual(
16-
resolveNightlyReleaseMetadata("9.9.9", "20260413", 321, "abcdef1234567890"),
23+
resolveNightlyReleaseMetadata("9.9.10", "20260413", 321, "abcdef1234567890"),
1724
{
18-
baseVersion: "9.9.9",
19-
version: "9.9.9-nightly.20260413.321",
20-
tag: "nightly-v9.9.9-nightly.20260413.321",
21-
name: "T3 Code Nightly 9.9.9-nightly.20260413.321 (abcdef123456)",
25+
baseVersion: "9.9.10",
26+
version: "9.9.10-nightly.20260413.321",
27+
tag: "nightly-v9.9.10-nightly.20260413.321",
28+
name: "T3 Code Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
2229
shortSha: "abcdef123456",
2330
},
2431
);

‎scripts/resolve-nightly-release.ts‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ const decodeDesktopPackageJson = Schema.decodeUnknownEffect(
3232

3333
export const resolveNightlyBaseVersion = (version: string) => version.replace(/[-+].*$/, "");
3434

35+
export const resolveNightlyTargetVersion = (version: string) => {
36+
const stableCore = resolveNightlyBaseVersion(version);
37+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(stableCore);
38+
if (!match) {
39+
throw new Error(`Invalid desktop package version '${version}'.`);
40+
}
41+
42+
const [, major, minor, patch] = match;
43+
return `${major}.${minor}.${Number(patch) + 1}`;
44+
};
45+
3546
export const resolveNightlyReleaseMetadata = (
3647
baseVersion: string,
3748
date: string,
@@ -59,7 +70,7 @@ const readDesktopBaseVersion = Effect.fn("readDesktopBaseVersion")(function* (
5970
const packageJson = yield* fs
6071
.readFileString(packageJsonPath)
6172
.pipe(Effect.flatMap(decodeDesktopPackageJson));
62-
return resolveNightlyBaseVersion(packageJson.version);
73+
return resolveNightlyTargetVersion(packageJson.version);
6374
});
6475

6576
const writeOutput = Effect.fn("writeOutput")(function* (

0 commit comments

Comments
 (0)