|
|
@@ -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.
|