From 01b3ca9973f4d8b0a52e8e3f435b01acd071aa31 Mon Sep 17 00:00:00 2001 From: Dongyu Zhao Date: Tue, 21 Jul 2026 14:00:33 -0500 Subject: [PATCH] [Release] Refresh Maven checksum sidecars after the publication merge. jar --update changes the JVM JAR bytes and the module metadata rewrite changes the .module file, but the staged repository's checksum sidecars still described the pre-merge contents, so a checksum-verifying consumer or a Central upload would reject the merged publication. Recompute the four sidecars for both mutated files; verified with a synthetic staged repository. Found while porting this script to tex-core. Co-Authored-By: Claude Fable 5 --- scripts/merge-maven-publications.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/merge-maven-publications.mjs b/scripts/merge-maven-publications.mjs index d7c91fa..67c2d09 100755 --- a/scripts/merge-maven-publications.mjs +++ b/scripts/merge-maven-publications.mjs @@ -53,6 +53,14 @@ for (const variant of moduleMetadata.variants) { } writeFileSync(modulePath, `${JSON.stringify(moduleMetadata, null, 2)}\n`); +// The staged repository carries Maven checksum sidecars next to every file; +// the two files mutated above must have theirs recomputed or a +// checksum-verifying consumer (and a Central upload) rejects the merged +// publication. +for (const mutated of [jvmJar, modulePath]) { + refreshSidecars(mutated); +} + const entries = execFileSync("unzip", ["-Z1", jvmJar], { encoding: "utf8" }); for (const required of [ "com/nouprax/markdown/core/native/linux-x64/libmarkdown_core_kotlin.so", @@ -90,3 +98,11 @@ function walk(directory, prefix = "") { function digest(algorithm, bytes) { return createHash(algorithm).update(bytes).digest("hex"); } + +function refreshSidecars(file) { + const contents = readFileSync(file); + for (const algorithm of ["md5", "sha1", "sha256", "sha512"]) { + const sidecar = `${file}.${algorithm}`; + if (existsSync(sidecar)) writeFileSync(sidecar, digest(algorithm, contents)); + } +}