Files
openclaw/scripts/plugin-clawhub-release-check.ts
Vincent Koc f5a7f613ee fix(release): use monthly patch versions
Switch release train handling to YYYY.M.PATCH monthly patch numbering, preserve pre-transition compatibility, and pin the June 2026 stable/beta floor at 2026.6.5 after the published beta.

Verification:
- node scripts/run-vitest.mjs run test/appcast.test.ts test/release-check.test.ts test/scripts/package-mac-app.test.ts test/scripts/package-mac-dist.test.ts test/openclaw-npm-release-check.test.ts test/npm-publish-plan.test.ts src/infra/npm-registry-spec.test.ts src/infra/clawhub.test.ts src/plugins/clawhub.test.ts test/plugin-npm-release.test.ts test/scripts/ios-version.test.ts test/scripts/ios-pin-version.test.ts
- node --import tsx scripts/plugin-npm-release-check.ts --base-ref origin/main --head-ref HEAD
- node --import tsx scripts/plugin-clawhub-release-check.ts --base-ref origin/main --head-ref HEAD
- git diff --check origin/main...HEAD
- .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --no-web-search
2026-06-06 12:26:32 -07:00

61 lines
2.0 KiB
JavaScript

#!/usr/bin/env -S node --import tsx
// Plugin Clawhub Release Check script supports OpenClaw repository automation.
import { pathToFileURL } from "node:url";
import {
collectClawHubPublishablePluginPackages,
collectClawHubVersionGateErrors,
assertPluginReleaseVersionFloors,
parsePluginReleaseArgs,
resolveSelectedClawHubPublishablePluginPackages,
} from "./lib/plugin-clawhub-release.ts";
export async function runPluginClawHubReleaseCheck(argv: string[]) {
const { selection, selectionMode, baseRef, headRef } = parsePluginReleaseArgs(argv);
const publishable = collectClawHubPublishablePluginPackages(".", {
packageNames:
selectionMode === "all-publishable" || selection.length === 0 ? undefined : selection,
});
const gitRange = baseRef && headRef ? { baseRef, headRef } : undefined;
const selected = resolveSelectedClawHubPublishablePluginPackages({
plugins: publishable,
selection,
selectionMode,
gitRange,
});
if (selectionMode !== undefined || selection.length > 0) {
assertPluginReleaseVersionFloors(selected, "plugin-clawhub-release-check");
}
if (gitRange) {
const errors = collectClawHubVersionGateErrors({
plugins: publishable,
gitRange,
});
if (errors.length > 0) {
throw new Error(
`plugin-clawhub-release-check: version bumps required before ClawHub publish:\n${errors
.map((error) => ` - ${error}`)
.join("\n")}`,
);
}
}
console.log("plugin-clawhub-release-check: publishable plugin metadata looks OK.");
if (gitRange && selected.length === 0) {
console.log(
` - no publishable plugin package changes detected between ${gitRange.baseRef} and ${gitRange.headRef}`,
);
}
for (const plugin of selected) {
console.log(
` - ${plugin.packageName}@${plugin.version} (${plugin.channel}, ${plugin.extensionId})`,
);
}
}
if (import.meta.url === pathToFileURL(process.argv[1] ?? "").href) {
await runPluginClawHubReleaseCheck(process.argv.slice(2));
}