Browse Source

docs: stop the manual checksums.txt rebuild if an asset is not fully uploaded

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jamesread 21 hours ago
parent
commit
b30667274f
1 changed files with 7 additions and 1 deletions
  1. 7 1
      docs/modules/dev/pages/signing.adoc

+ 7 - 1
docs/modules/dev/pages/signing.adoc

@@ -25,13 +25,19 @@ Rebuild the manifest by hand from the release's own files when a fully uploaded
 
 Before you start, make sure no `sign-windows` or `sign-macos` job is running or queued for the release. The manual commands are outside the jobs' concurrency group, so a job that updates `checksums.txt` while they run would have its lines overwritten.
 
-The commands run in a subshell that stops at the first error, so a failed download or hash never uploads a partial manifest:
+The commands run in a subshell that stops at the first error, so a failed download or hash never uploads a partial manifest. They also stop if any asset other than `checksums.txt` is not fully uploaded, because hashing a partial file would publish a checksum for the wrong bytes. Upload that asset again, or delete it with `gh release delete-asset`, then run the commands again. A signed file deleted here is uploaded again by the re-run.
 
 [source,bash]
 ----
 (
   set -euo pipefail
   tag=<tag>
+  incomplete="$(gh release view "${tag}" --repo OliveTin/OliveTin --json assets \
+    --jq '.assets[] | select(.name != "checksums.txt" and .state != "uploaded") | .name')"
+  if [[ -n "${incomplete}" ]]; then
+    echo "Not fully uploaded: ${incomplete}" >&2
+    exit 1
+  fi
   workdir="$(mktemp -d)"
   mkdir "${workdir}/assets"
   gh release download "${tag}" --repo OliveTin/OliveTin --dir "${workdir}/assets"