This repository has been archived on 2026-09-30. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ForgeFlow/src/shared/release-policy.cjs
T
NuklearRabbit 8769f07539
Managed validation / full (pull_request) Successful in 27s
ChatGPT validation / quality (push) Successful in 21m36s
release: bridge legacy installations to ForgeFlow-Public
2026-09-30 23:02:50 +02:00

28 lines
1.1 KiB
JavaScript

'use strict';
function windowsReleaseAssetNames(version) {
return [
...['Setup', 'Portable'].flatMap((kind) => {
const name = `ForgeFlow-${kind}-${version}-win-x64.exe`;
return [name, `${name}.sha256`];
}),
`ForgeFlow-${version}-provenance.json`,
`ForgeFlow-${version}-sbom.cdx.json`,
`ForgeFlow-${version}-release-manifest.json`,
`ForgeFlow-${version}-release-manifest.json.sig`
];
}
function existingReleaseState(release, version, commit) {
if (release.target_commitish !== commit) {
throw new Error(`Release v${version} already targets ${release.target_commitish}; refusing assets from ${commit}. Bump the version for a new source commit.`);
}
if (release.draft) return 'draft';
const names = new Set((release.assets || []).map((asset) => asset.name));
const missing = windowsReleaseAssetNames(version).filter((name) => !names.has(name));
if (missing.length) throw new Error(`Published release v${version} is missing: ${missing.join(', ')}.`);
return 'published';
}
module.exports = { windowsReleaseAssetNames, existingReleaseState };