refactor(release): remove obsolete tag CLI and proposal output

This commit is contained in:
morluto
2026-10-24 11:37:30 +08:00
parent 39aca92239
commit f2eb27206f
3 changed files with 1 additions and 24 deletions
-8
View File
@@ -1,15 +1,7 @@
import semver from "semver";
import { resolve } from "node:path";
import { fileURLToPath } from "node:url";
export function releaseNpmTag(version) {
if (version === undefined || semver.valid(version) !== version)
throw new Error("Expected an exact SemVer version.");
return semver.prerelease(version) === null ? "latest" : "next";
}
if (
process.argv[1] !== undefined &&
resolve(process.argv[1]) === fileURLToPath(import.meta.url)
)
process.stdout.write(releaseNpmTag(process.argv[2]));
+1 -1
View File
@@ -56,7 +56,7 @@ async function main() {
if (process.env.GITHUB_OUTPUT) {
await appendFile(
process.env.GITHUB_OUTPUT,
`prs_created=${prs.length > 0}\n${prs.length ? `pr=${JSON.stringify(prs[0])}\nprs=${JSON.stringify(prs)}\n` : ""}`,
`prs_created=${prs.length > 0}\n${prs.length ? `pr=${JSON.stringify(prs[0])}\n` : ""}`,
);
}
}
@@ -1,7 +1,6 @@
import { execFile } from "node:child_process";
import { readFile, writeFile } from "node:fs/promises";
import { delimiter, join } from "node:path";
import { fileURLToPath } from "node:url";
import { promisify } from "node:util";
import { expect, it } from "vitest";
import { parse } from "yaml";
@@ -542,20 +541,6 @@ it("binds npm and MCP publication to the same immutable release SHA", async () =
expect(publishCommand).toContain(
'--registry=https://registry.npmjs.org --access=public --tag="$NPM_RELEASE_TAG"',
);
for (const [version, tag] of [
["6.1.0", "latest"],
["6.1.0-rc.1", "next"],
] as const) {
const helper = new URL(
"../../../scripts/release-npm-tag.mjs",
import.meta.url,
);
const result = await execFileAsync(process.execPath, [
fileURLToPath(helper),
version,
]);
expect(result.stdout).toBe(tag);
}
});
it.skipIf(process.platform === "win32").each([