Skip to content

armgit / raea

Public Imported from GitHub
0

Render Anything Engine: tell your AI what to make. Videos, motion graphics, 3D and games as React and TypeScript, rendered on your own GPU. Rust + Bevy, macOS, Linux and Windows.

Release promote: a release can go as soon as the Mac's candidate archive is out (Shane, 11-11: "once mac is ready we can go live too"). tools/release/promoted-bins.sh waits for a platform's candidate archive (and its .sha256) while the candidate's own release run is still building it, every two minutes, and fails at once when that run has ended without one; so v0.1.1's Windows job promotes rc5's zip as soon as rc5's windows-verify attaches it. Tested: rc5's Mac archive, still building, is waited for; rc4's Mac archive, built by the release-disk branch's dispatch, is refused by the attestation check (source ref refs/heads/release-disk, not the tag)

shinyobjectz8d111c6f5b11
diff --git a/tools/release/promoted-bins.sh b/tools/release/promoted-bins.sh
index 3766da79..42df5836 100755
--- a/tools/release/promoted-bins.sh
+++ b/tools/release/promoted-bins.sh
@@ -19,6 +19,19 @@ esac
archive=raea-$v-$platform.$ext
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
+# the candidate's own release run (a tag push), for its symbols and to know whether an archive is still coming
+run=$(gh run list -R "$repo" -w release.yml --branch "$from" -L 20 --json databaseId,event -q '[.[] | select(.event == "push")][0].databaseId')
+
+# a release can go as soon as the Mac's archive is out (Shane, 11-11: "once mac is ready we can go live too"): a
+# platform whose candidate archive is still being built waits for it here while the candidate's run goes on, and
+# fails once that run has ended without one
+attached() { local names; names=$(gh release view "$from" -R "$repo" --json assets -q '.assets[].name' 2>/dev/null) || return 1; grep -qx "$1" <<< "$names"; }
+until attached "$archive" && attached "$archive.sha256"; do
+ st=$([ -n "$run" ] && gh run view "$run" -R "$repo" --json status -q .status || echo unknown)
+ [ "$st" = completed ] || [ "$st" = unknown ] && die "$from's release has no $archive, and its run ${run:-(not found)} isn't building one"
+ echo "promoted-bins: waiting for $from's $archive (its run $run is $st)"
+ sleep 120
+done
gh release download "$from" -R "$repo" -p "$archive" -p "$archive.sha256" -D "$tmp" || die "$from's release has no $archive"
(cd "$tmp" && if command -v sha256sum >/dev/null; then sha256sum -c "$archive.sha256"; else shasum -a 256 -c "$archive.sha256"; fi) \
@@ -36,7 +49,6 @@ ls -l "$dest"
# the symbols release.sh kept beside the candidate's archive, uploaded by its run as symbols-<OS> (Windows keeps none)
[ "$os" = Windows ] && exit 0
-run=$(gh run list -R "$repo" -w release.yml --branch "$from" -L 20 --json databaseId,event -q '[.[] | select(.event == "push")][0].databaseId')
if [ -n "$run" ] && gh run download "$run" -R "$repo" -n "symbols-$os" -D "$tmp/sym" 2>/dev/null; then
src=$tmp/sym
# the artifact holds raea-VERSION-PLATFORM-symbols/ itself, or only what's in it