From a6364e30d811eeb59a82cd1cf7ce2d3446a8ef94 Mon Sep 17 00:00:00 2001 From: Luis <42945842+ldiaz94@users.noreply.github.com> Date: Mon, 26 Oct 2026 19:00:06 +0000 Subject: [PATCH] boot.sh: BOOT's tarball from site/public/download/ first, the website last, so a deploy that builds raz needs no access to GitHub --- diff --git a/src/boot.sh b/src/boot.sh index b2b747a..794b7ed 100755 --- a/src/boot.sh +++ b/src/boot.sh @@ -7,11 +7,14 @@ # raz can always be built again from source alone. # # The tarball is taken from build/boot/ if it is there; else from the -# GitHub release, by curl, or by gh's REST API where the repository is -# private and gh has a token; a machine with no network has it put -# there by hand. Its raz goes to build/boot/raz, with this repository's -# lib/ beside it, since src/ is built against today's library. Run from -# the repository root, by make. +# website's downloads in this checkout, site/public/download/, where +# every release is kept; else from the GitHub release, by curl, or by +# gh's REST API where the repository is private and gh has a token; else +# from the website, which serves the same bytes. A machine with no +# network and no site/public has it put there by hand. The sum is +# checked whichever it came from. Its raz goes to build/boot/raz, with +# this repository's lib/ beside it, since src/ is built against today's +# library. Run from the repository root, by make. set -e read tag sum < BOOT v=${tag#v} @@ -19,11 +22,15 @@ d=build/boot repo=ldiaz94/raz mkdir -p $d +if [ ! -f $d/$t ] && [ -f site/public/download/$t ]; then + cp site/public/download/$t $d/$t +fi if [ ! -f $d/$t ]; then if ! curl -fsSL -o $d/$t https://github.com/$repo/releases/download/$tag/$t 2>/dev/null; then id=$(gh api repos/$repo/releases/tags/$tag --jq ".assets[] | select(.name == \"$t\") | .id" 2>/dev/null) && [ -n "$id" ] && gh api -H 'Accept: application/octet-stream' repos/$repo/releases/assets/$id >$d/$t 2>/dev/null || + curl -fsSL -o $d/$t https://raz.lucelad.workers.dev/download/$t 2>/dev/null || { rm -f $d/$t; echo "boot: can't fetch $t; put it in $d" >&2; exit 1; } fi fi