Skip to content

Commit c83bc5d

Browse files
authored
fix(release): use v<semver> tag format for nightly releases (pingdotgg#2186)
1 parent 9df3c64 commit c83bc5d

5 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
tags:
66
- "v*.*.*"
7+
- "!v*-nightly.*"
78
schedule:
89
- cron: "0 */3 * * *"
910
workflow_dispatch:
@@ -41,7 +42,7 @@ jobs:
4142
- id: check
4243
name: Compare HEAD to last nightly tag
4344
run: |
44-
last_nightly_tag=$(git tag --list 'nightly-v*' --sort=-creatordate | head -n 1)
45+
last_nightly_tag=$(git tag --list 'v*-nightly.*' 'nightly-v*' --sort=-creatordate | head -n 1)
4546
if [[ -z "$last_nightly_tag" ]]; then
4647
echo "No previous nightly tag found. Proceeding with release."
4748
echo "has_changes=true" >> "$GITHUB_OUTPUT"

scripts/release-smoke.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ try {
220220
);
221221
assertContains(
222222
nightlyReleaseMetadata,
223-
"tag=nightly-v9.9.10-nightly.20260413.321",
223+
"tag=v9.9.10-nightly.20260413.321",
224224
"Expected nightly metadata to contain the derived nightly tag.",
225225
);
226226
assertContains(

scripts/resolve-nightly-release.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ it("derives nightly metadata including the short commit sha in the release name"
2424
{
2525
baseVersion: "9.9.10",
2626
version: "9.9.10-nightly.20260413.321",
27-
tag: "nightly-v9.9.10-nightly.20260413.321",
27+
tag: "v9.9.10-nightly.20260413.321",
2828
name: "T3 Code Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
2929
shortSha: "abcdef123456",
3030
},

scripts/resolve-nightly-release.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const resolveNightlyReleaseMetadata = (
5454
return {
5555
baseVersion,
5656
version,
57-
tag: `nightly-v${version}`,
57+
tag: `v${version}`,
5858
name: `T3 Code Nightly ${version} (${shortSha})`,
5959
shortSha,
6060
};

scripts/resolve-previous-release-tag.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,17 @@ const parseStableTag = (tag: string): StableVersion | undefined => {
7575
const [, major, minor, patch, prerelease] = match;
7676
if (!major || !minor || !patch) return undefined;
7777

78+
const prereleaseIdentifiers = prerelease ? prerelease.split(".") : [];
79+
// Nightly tags also start with `v` and carry a `nightly.*` prerelease
80+
// identifier. They must not be considered stable candidates when resolving
81+
// the previous stable tag.
82+
if (prereleaseIdentifiers[0] === "nightly") return undefined;
83+
7884
return {
7985
major: Number(major),
8086
minor: Number(minor),
8187
patch: Number(patch),
82-
prerelease: prerelease ? prerelease.split(".") : [],
88+
prerelease: prereleaseIdentifiers,
8389
};
8490
};
8591

@@ -92,7 +98,9 @@ const compareNightlyVersions = (left: NightlyVersion, right: NightlyVersion): nu
9298
};
9399

94100
const parseNightlyTag = (tag: string): NightlyVersion | undefined => {
95-
const match = /^nightly-v(\d+)\.(\d+)\.(\d+)-nightly\.(\d{8})\.(\d+)$/.exec(tag);
101+
// Accept both the current `v<semver>` format and the legacy `nightly-v<semver>`
102+
// format so release note diffs keep working across the tag-format transition.
103+
const match = /^(?:nightly-)?v(\d+)\.(\d+)\.(\d+)-nightly\.(\d{8})\.(\d+)$/.exec(tag);
96104
if (!match) return undefined;
97105

98106
const [, major, minor, patch, date, runNumber] = match;

0 commit comments

Comments
 (0)