Sync public tree to 13dc821

This commit is contained in:
Michel Paulissen 2026-07-04 13:10:21 +02:00
parent e2bc145f60
commit 1dad0df5c4
6 changed files with 101 additions and 21 deletions

View file

@ -98,6 +98,22 @@ function resolveRepoIdentity(manifest) {
}
}
function publicTreeAlreadyPushed(manifest) {
return (
(manifest.public_tree_publish && manifest.public_tree_publish.pushed === true) ||
process.env.DISASMER_PUBLIC_TREE_ALREADY_PUSHED === "1"
);
}
function publicTreeCommit(manifest) {
return (
(manifest.public_tree_publish && manifest.public_tree_publish.commit) ||
process.env.DISASMER_PUBLIC_TREE_COMMIT ||
process.env.DISASMER_PUBLIC_RELEASE_TARGET ||
null
);
}
function apiPath(pathname) {
return `/api/v1${pathname}`;
}
@ -190,8 +206,7 @@ async function createOrReuseRelease(manifest) {
return { release: found, created: false };
}
const targetCommitish =
(manifest.public_tree_publish && manifest.public_tree_publish.commit) ||
process.env.DISASMER_PUBLIC_RELEASE_TARGET ||
publicTreeCommit(manifest) ||
"main";
const body = [
"Disasmer public release dry run.",
@ -264,11 +279,8 @@ async function main() {
"public release manifest is stale; regenerate it for the current acceptance commit before publishing the Forgejo Release"
);
}
const publicTreeAlreadyPushed =
process.env.DISASMER_PUBLIC_TREE_ALREADY_PUSHED === "1";
if (
!publicTreeAlreadyPushed &&
(!manifest.public_tree_publish || manifest.public_tree_publish.pushed !== true)
!publicTreeAlreadyPushed(manifest)
) {
throw new Error(
"public tree must be pushed before publishing the Forgejo Release; run prepare-public-release-dryrun.js with DISASMER_PUBLISH_PUBLIC_TREE=1"
@ -306,6 +318,7 @@ async function main() {
release_created: created,
default_operator_endpoint: manifest.default_operator_endpoint,
public_tree_identity: manifest.public_tree_identity,
public_tree_commit: publicTreeCommit(manifest),
source_commit: manifest.source_commit,
uploaded_assets: uploaded.map((asset) => ({
id: asset.id,