fix(release): use v<semver> tag format for nightly releases (#2186)
This commit is contained in:
1 parent
9df3c64021
commit
c83bc5d48a
5 files changed
+15
-6
No files matched your search
@@ -220,7 +220,7 @@ try {
|
||||
);
|
||||
assertContains(
|
||||
nightlyReleaseMetadata,
|
||||
"tag=nightly-v9.9.10-nightly.20260413.321",
|
||||
"tag=v9.9.10-nightly.20260413.321",
|
||||
"Expected nightly metadata to contain the derived nightly tag.",
|
||||
);
|
||||
assertContains(
|
||||
|
||||
@@ -24,7 +24,7 @@ it("derives nightly metadata including the short commit sha in the release name"
|
||||
{
|
||||
baseVersion: "9.9.10",
|
||||
version: "9.9.10-nightly.20260413.321",
|
||||
tag: "nightly-v9.9.10-nightly.20260413.321",
|
||||
tag: "v9.9.10-nightly.20260413.321",
|
||||
name: "T3 Code Nightly 9.9.10-nightly.20260413.321 (abcdef123456)",
|
||||
shortSha: "abcdef123456",
|
||||
},
|
||||
|
||||
@@ -54,7 +54,7 @@ export const resolveNightlyReleaseMetadata = (
|
||||
return {
|
||||
baseVersion,
|
||||
version,
|
||||
tag: `nightly-v${version}`,
|
||||
tag: `v${version}`,
|
||||
name: `T3 Code Nightly ${version} (${shortSha})`,
|
||||
shortSha,
|
||||
};
|
||||
|
||||
@@ -75,11 +75,17 @@ const parseStableTag = (tag: string): StableVersion | undefined => {
|
||||
const [, major, minor, patch, prerelease] = match;
|
||||
if (!major || !minor || !patch) return undefined;
|
||||
|
||||
const prereleaseIdentifiers = prerelease ? prerelease.split(".") : [];
|
||||
// Nightly tags also start with `v` and carry a `nightly.*` prerelease
|
||||
// identifier. They must not be considered stable candidates when resolving
|
||||
// the previous stable tag.
|
||||
if (prereleaseIdentifiers[0] === "nightly") return undefined;
|
||||
|
||||
return {
|
||||
major: Number(major),
|
||||
minor: Number(minor),
|
||||
patch: Number(patch),
|
||||
prerelease: prerelease ? prerelease.split(".") : [],
|
||||
prerelease: prereleaseIdentifiers,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -92,7 +98,9 @@ const compareNightlyVersions = (left: NightlyVersion, right: NightlyVersion): nu
|
||||
};
|
||||
|
||||
const parseNightlyTag = (tag: string): NightlyVersion | undefined => {
|
||||
const match = /^nightly-v(\d+)\.(\d+)\.(\d+)-nightly\.(\d{8})\.(\d+)$/.exec(tag);
|
||||
// Accept both the current `v<semver>` format and the legacy `nightly-v<semver>`
|
||||
// format so release note diffs keep working across the tag-format transition.
|
||||
const match = /^(?:nightly-)?v(\d+)\.(\d+)\.(\d+)-nightly\.(\d{8})\.(\d+)$/.exec(tag);
|
||||
if (!match) return undefined;
|
||||
|
||||
const [, major, minor, patch, date, runNumber] = match;
|
||||
|
||||
Reference in new issue
Block a user