feat(release): add incremental gate and auto CI status for 103 publish

When the runtime artifact is unchanged, carry forward prior gate results and
re-run only REL scenarios; resolve REL-02 from Gitea commit status and allow
stable promotion when canary matches the same artifact bundle.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
john
2026-07-27 08:32:12 +08:00
parent 9e2aa4f71d
commit a6a9bb4eab
11 changed files with 533 additions and 10 deletions
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env node
import { runCommand } from '../release-gate/runner.mjs';
import { resolveReleaseCiStatus } from '../release-gate/ci-status.mjs';
const ROOT = new URL('..', import.meta.url).pathname;
function parseArgs(argv) {
const options = { commit: null };
for (let index = 2; index < argv.length; index += 1) {
const arg = argv[index];
if (arg === '--commit') options.commit = argv[++index] ?? '';
else throw new Error(`Unknown argument: ${arg}`);
}
return options;
}
async function git(...args) {
const result = await runCommand('git', args, { cwd: ROOT, timeoutMs: 30_000 });
if (result.code !== 0) throw new Error(`git ${args.join(' ')} failed`);
return result.stdout.trim();
}
try {
const options = parseArgs(process.argv);
const commitSha = options.commit ?? await git('rev-parse', 'HEAD');
const status = await resolveReleaseCiStatus(commitSha);
process.stdout.write(`${status}\n`);
process.exit(status === 'success' ? 0 : 1);
} catch (error) {
console.error(error.message);
process.exit(1);
}