Просмотр исходного кода

docs: stop the manual checksums.txt rebuild at the first error

Run the recovery commands in a subshell with set -euo pipefail so a
failed download or hash cannot upload a partial manifest.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
jamesread 22 часов назад
Родитель
Сommit
cda5f66ee2
1 измененных файлов с 11 добавлено и 6 удалено
  1. 11 6
      docs/modules/dev/pages/signing.adoc

+ 11 - 6
docs/modules/dev/pages/signing.adoc

@@ -19,15 +19,20 @@ If `sign-macos` fails (for example an expired Apple agreement, a notary outage o
 
 The signed files are uploaded before `checksums.txt`. If the `checksums.txt` upload still fails after retries, the job fails and the release holds the new files with an out-of-date manifest. A re-run updates the release's current `checksums.txt` and uploads it again. If the failed upload left the release with no `checksums.txt`, or an incomplete one, the re-run rebuilds it from the sha256 digests GitHub records for each release asset.
 
-If any release asset has no recorded digest, the rebuild stops and the re-run fails. Rebuild the manifest by hand from the release's own files, then re-run the job:
+If any release asset has no recorded digest, the rebuild stops and the re-run fails. Rebuild the manifest by hand from the release's own files, then re-run the job. The commands run in a subshell that stops at the first error, so a failed download or hash never uploads a partial manifest:
 
 [source,bash]
 ----
-mkdir assets && cd assets
-gh release download <tag> --repo OliveTin/OliveTin --skip-existing
-rm -f checksums.txt
-sha256sum * > ../checksums.txt
-gh release upload <tag> ../checksums.txt --repo OliveTin/OliveTin --clobber
+(
+  set -euo pipefail
+  tag=<tag>
+  workdir="$(mktemp -d)"
+  mkdir "${workdir}/assets"
+  gh release download "${tag}" --repo OliveTin/OliveTin --dir "${workdir}/assets"
+  rm -f "${workdir}/assets/checksums.txt"
+  (cd "${workdir}/assets" && sha256sum -- *) > "${workdir}/checksums.txt"
+  gh release upload "${tag}" "${workdir}/checksums.txt" --repo OliveTin/OliveTin --clobber
+)
 ----
 
 `sign-windows` and `sign-macos` share a concurrency group, so they never update `checksums.txt` at the same time.