mirror of
https://github.com/morluto/rea
synced 2026-10-25 14:01:13 -04:00
refactor(release): remove obsolete tag CLI and proposal output
This commit is contained in:
@@ -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]));
|
||||
|
||||
@@ -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([
|
||||
|
||||
Reference in New Issue
Block a user