docs: publish a release only once its assets are up

This commit is contained in:
Abdessamad Derraz committed 2026-09-04 04:16:58 +02:00
1 parent 7ff6ea20d1
commit 9669ae06d2
1 file changed
+11 -3
+11 -3
View File
@@ -151,10 +151,18 @@ for f in dist/*.zip; do
split --bytes=1900M --numeric-suffixes=1 --suffix-length=3 "$f" "$f." && rm "$f"
done
# 5. Create the release, then keep the three most recent plus large-files
# 5. Create the release as a DRAFT, upload every asset, and only then publish it.
# A public release with half its assets is a broken download for everyone
# during the whole upload.
DATE=$(date +%Y.%m.%d)
gh release create "v${DATE}" dist/*.zip* dist/SHA256SUMS.txt \
--title "BIOS Pack v${DATE}" --notes-file notes.md --latest
gh release create "v${DATE}" --draft --title "BIOS Pack v${DATE}" --notes-file notes.md
for f in dist/SHA256SUMS.txt dist/*.zip dist/*.zip.0*; do
[ -f "$f" ] && gh release upload "v${DATE}" "$f#$(basename "$f")" --clobber
done
gh release view "v${DATE}" --json assets --jq '.assets | length' # expect every file
gh release edit "v${DATE}" --draft=false --latest
# 6. Keep the three most recent releases plus large-files
gh release list --json tagName,createdAt \
--jq 'sort_by(.createdAt) | reverse | .[].tagName' | grep -v '^large-files$' \
| tail -n +4 | while read tag; do gh release delete "$tag" --yes --cleanup-tag; done