|
|
@@ -17,7 +17,35 @@ Like Windows signing, this happens **after** the release is published, so a prob
|
|
|
|
|
|
If `sign-macos` fails (for example an expired Apple agreement, a notary outage or a certificate problem), the release stays published without macOS assets. Fix the cause, then use **Re-run failed jobs** on that workflow run. The unsigned artifact must still be within its retention period.
|
|
|
|
|
|
-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`, the re-run rebuilds it from the sha256 digests GitHub records for each release asset.
|
|
|
+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 with one GitHub has not marked as fully uploaded, the re-run rebuilds it from the sha256 digests GitHub records for each release asset.
|
|
|
+
|
|
|
+A re-run trusts a fully uploaded `checksums.txt`. It only adds or replaces lines for the files it signs, so it cannot restore entries for other assets that are missing from it.
|
|
|
+
|
|
|
+Rebuild the manifest by hand from the release's own files when a fully uploaded `checksums.txt` is missing entries for other assets, or when a release asset has no recorded digest (the rebuild then stops and the re-run fails). Then re-run the job.
|
|
|
+
|
|
|
+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. 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 when you re-run the job that signed it: `sign-windows` for Windows files, `sign-macos` for macOS files.
|
|
|
+
|
|
|
+[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"
|
|
|
+ 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.
|
|
|
|