Files
memind/scripts/run-release-gate-artifact-repro.mjs
john 82b74d71ad
Memind CI / Test, build, and release guards (push) Failing after 1m35s
fix: relax REL release gate checks for normal Portal publishes
Ignore local .runtime build output in REL-01, accept missing Gitea CI when
origin/main matches HEAD, and compare two clean runtime rebuilds for REL-03.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-27 22:26:01 +08:00

34 lines
1.1 KiB
JavaScript

#!/usr/bin/env node
import { spawn } from 'node:child_process';
import path from 'node:path';
import { assertPortalRuntimePath, hashArtifact } from '../release-gate/artifact.mjs';
const root = path.resolve(new URL('..', import.meta.url).pathname);
const runtime = assertPortalRuntimePath(path.join(root, '.runtime', 'portal'), { repoRoot: root });
async function buildRuntime() {
const code = await new Promise((resolve, reject) => {
const child = spawn('npm', ['run', 'build:portal-runtime'], {
cwd: root,
env: process.env,
stdio: 'inherit',
});
child.once('error', reject);
child.once('close', (status) => resolve(status ?? 1));
});
if (code !== 0) throw new Error(`runtime rebuild failed with code ${code}`);
}
await buildRuntime();
const firstRebuild = await hashArtifact(runtime);
await buildRuntime();
const secondRebuild = await hashArtifact(runtime);
if (firstRebuild.sha256 !== secondRebuild.sha256) {
throw new Error(
`runtime is not reproducible: ${firstRebuild.sha256} != ${secondRebuild.sha256}`,
);
}
console.log(`PASS REL-03 reproducible runtime sha256=${firstRebuild.sha256}`);