release: the PC stick image, and a Gitea release anyone can download from (#126)
- scripts/nightly.sh images builds the PC's USB stick too (make boot_image TARGET=PC -> pc-stick.img.xz, in SHA256SUMS); publish sends it to Nexus as classifier pc-stick. pc stays the ISO QEMU boots. - scripts/nightly.sh gitea-release <tag>: the tag as a Gitea release -- a pre-release for -alpha.N and the like -- notes from the tag's message with the checksums, the images, SHA256SUMS, the documents and the StarshipOS Root CA's certificate attached; run again, it adds only what is missing. release.yml runs it after the Nexus publish, with the secret RELEASE_TOKEN. Tested here: images builds pc-stick.img.xz (785 KB); gitea-release against a stand-in Gitea API made a pre-release with the notes and ten files, and a second run added nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
This commit is contained in:
+46
-7
@@ -22,6 +22,7 @@
|
||||
# logs/<TS>/isabelle/, as a boot's is.
|
||||
# scripts/nightly.sh images
|
||||
# The board images, into build/nightly/:
|
||||
# pc-stick.img.xz a PC's USB stick (make boot_image TARGET=PC): GPT, one ESP, any UEFI PC
|
||||
# raspi5.img.xz Raspberry Pi 5 (make boot_image TARGET=RASPI), for Raspberry Pi Imager
|
||||
# MilkV.img.xz Milk-V Mars (make boot_image TARGET=MILKV)
|
||||
# SHA256SUMS of StarshipOS.iso and both images, before and after compression
|
||||
@@ -29,7 +30,7 @@
|
||||
# same sources, for hardware QEMU does not model.
|
||||
# scripts/nightly.sh publish <URL>
|
||||
# org.starship:kernelImage:<VERSION> to that Maven repository, in one deploy (one
|
||||
# timestamp): classifier pc (iso), raspi5 and milkv (img.xz), and logs (tar.gz: this
|
||||
# timestamp): classifier pc (iso, for QEMU), pc-stick, raspi5 and milkv (img.xz), and logs (tar.gz: this
|
||||
# run's serial logs and DoE CSVs -- the evidence for the rest; and the proof log, when the
|
||||
# proofs ran before it, as a release runs them).
|
||||
#
|
||||
@@ -54,7 +55,7 @@ LITHOS=$(sed -n 's/^LITHOS_VERSION *?= *//p' kernel/Makefile)
|
||||
VERSION=${NIGHTLY_VERSION:-$LITHOS-SNAPSHOT}
|
||||
usage() {
|
||||
echo "Usage: scripts/nightly.sh accept <amd64|aarch64|riscv64|stick-high> | test-32 | proofs | images" >&2
|
||||
echo " | publish <URL> | docs | publish-docs <URL>" >&2
|
||||
echo " | publish <URL> | docs | publish-docs <URL> | gitea-release <tag>" >&2
|
||||
exit 2
|
||||
}
|
||||
need() { for f in "$@"; do [ -f "$f" ] || { echo "nightly: no $f -- run the stages before this one" >&2; exit 1; }; done; }
|
||||
@@ -138,7 +139,7 @@ proofs)
|
||||
;;
|
||||
images)
|
||||
need "$OUT/StarshipOS.iso"
|
||||
for b in "RASPI raspi/lithos-raspi.img raspi5.img" "MILKV milkv/lithos-milkv.img MilkV.img"; do
|
||||
for b in "PC pc/lithos-pc.img pc-stick.img" "RASPI raspi/lithos-raspi.img raspi5.img" "MILKV milkv/lithos-milkv.img MilkV.img"; do
|
||||
set -- $b
|
||||
echo "=== nightly: image $1"
|
||||
make --no-print-directory boot_image TARGET="$1"
|
||||
@@ -147,18 +148,20 @@ images)
|
||||
# boot_image regenerates these (the source SBOM, and what qemu_session.py also puts back);
|
||||
# the nightly does not change the tree
|
||||
git checkout -q -- sbom.spdx sbom.spdx.json capsules/BLOCK_MAP.md v3/include/version.h
|
||||
(cd "$OUT" && rm -f raspi5.img.xz MilkV.img.xz && sha256sum StarshipOS.iso raspi5.img MilkV.img > SHA256SUMS)
|
||||
xz -T0 -6 "$OUT/raspi5.img" "$OUT/MilkV.img"
|
||||
(cd "$OUT" && sha256sum raspi5.img.xz MilkV.img.xz >> SHA256SUMS && cat SHA256SUMS)
|
||||
(cd "$OUT" && rm -f pc-stick.img.xz raspi5.img.xz MilkV.img.xz &&
|
||||
sha256sum StarshipOS.iso pc-stick.img raspi5.img MilkV.img > SHA256SUMS)
|
||||
xz -T0 -6 "$OUT/pc-stick.img" "$OUT/raspi5.img" "$OUT/MilkV.img"
|
||||
(cd "$OUT" && sha256sum pc-stick.img.xz raspi5.img.xz MilkV.img.xz >> SHA256SUMS && cat SHA256SUMS)
|
||||
;;
|
||||
publish)
|
||||
url=${2:-}; [ -n "$url" ] || usage
|
||||
need "$OUT/StarshipOS.iso" "$OUT/raspi5.img.xz" "$OUT/MilkV.img.xz"
|
||||
need "$OUT/StarshipOS.iso" "$OUT/pc-stick.img.xz" "$OUT/raspi5.img.xz" "$OUT/MilkV.img.xz"
|
||||
# the evidence: what this run wrote under logs/ and experiments/bare_metal/runs/
|
||||
find logs experiments/bare_metal/runs -type f -newer "$OUT/.started" -print0 \
|
||||
| tar --null -czf "$OUT/logs.tar.gz" -T -
|
||||
echo "=== nightly: logs.tar.gz: $(tar -tzf "$OUT/logs.tar.gz" | wc -l) files"
|
||||
deploy "$url" kernelImage "$OUT/StarshipOS.iso" iso pc \
|
||||
"$OUT/pc-stick.img.xz" img.xz pc-stick \
|
||||
"$OUT/raspi5.img.xz" img.xz raspi5 \
|
||||
"$OUT/MilkV.img.xz" img.xz milkv \
|
||||
"$OUT/logs.tar.gz" tar.gz logs
|
||||
@@ -172,6 +175,42 @@ docs)
|
||||
cp docs/formal/build/doxygen/StarForth-API-Reference.pdf "$DOCS/api.pdf"
|
||||
(cd "$DOCS" && sha256sum ./*.pdf | tee SHA256SUMS)
|
||||
;;
|
||||
gitea-release)
|
||||
# The release as Gitea's own (#126): a release for <tag> -- a pre-release when the tag names
|
||||
# one (v4.0.0-alpha.3) -- its notes the tag's message and the checksums, its files everyone's
|
||||
# to download from the public repository, no Nexus login: the images, SHA256SUMS, the
|
||||
# documents, and the StarshipOS Root CA's certificate (FABRIC-3 XLVI). Run again, it adds what
|
||||
# is missing and changes nothing else. RELEASE_TOKEN: a token that may write the repository.
|
||||
tag=${2:-}; [ -n "$tag" ] || usage
|
||||
: "${RELEASE_TOKEN:?RELEASE_TOKEN: a token that may write the repository}"
|
||||
api=${GITEA_API:-${GITHUB_SERVER_URL:-https://gitea.starshipos-f18.org}/api/v1/repos/${GITHUB_REPOSITORY:-rajames/LithosAnanke}}
|
||||
need "$OUT/StarshipOS.iso" "$OUT/pc-stick.img.xz" "$OUT/raspi5.img.xz" "$OUT/MilkV.img.xz" "$OUT/SHA256SUMS"
|
||||
files=("$OUT/StarshipOS.iso" "$OUT/pc-stick.img.xz" "$OUT/raspi5.img.xz" "$OUT/MilkV.img.xz" "$OUT/SHA256SUMS")
|
||||
for f in "$DOCS"/*.pdf ci/pki/starshipos-root-ca.pem; do [ -f "$f" ] && files+=("$f"); done
|
||||
gitea() { curl -fsS -H "Authorization: token $RELEASE_TOKEN" "$@"; }
|
||||
body=$(python3 -c '
|
||||
import json, sys
|
||||
notes, sums, version = sys.argv[1], open(sys.argv[2]).read(), sys.argv[3]
|
||||
print(json.dumps(notes.strip() + "\n\n## Checksums (SHA-256)\n\n```\n" + sums.strip() + "\n```\n\n"
|
||||
"Also in Nexus: `org.starship:kernelImage:" + version + "` and `org.starship:documentation:" + version + "`.\n"))' \
|
||||
"$(git tag -l --format='%(contents)' "$tag")" "$OUT/SHA256SUMS" "$VERSION")
|
||||
id=$(gitea "$api/releases/tags/$tag" 2>/dev/null | python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])' 2>/dev/null || true)
|
||||
if [ -z "$id" ]; then
|
||||
pre=false; case "$tag" in *-*) pre=true;; esac
|
||||
id=$(gitea -X POST -H 'Content-Type: application/json' "$api/releases" \
|
||||
-d "{\"tag_name\": \"$tag\", \"name\": \"$tag\", \"prerelease\": $pre, \"body\": $body}" |
|
||||
python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
|
||||
echo "=== nightly: Gitea release $tag made (id $id, pre-release $pre)"
|
||||
else
|
||||
echo "=== nightly: Gitea release $tag is there (id $id)"
|
||||
fi
|
||||
have=$(gitea "$api/releases/$id/assets" | python3 -c 'import json,sys; print(" ".join(a["name"] for a in json.load(sys.stdin)))')
|
||||
for f in "${files[@]}"; do
|
||||
n=$(basename "$f")
|
||||
case " $have " in *" $n "*) echo " $n: there"; continue;; esac
|
||||
gitea -o /dev/null -X POST -F "attachment=@$f" "$api/releases/$id/assets?name=$n" && echo " $n: attached"
|
||||
done
|
||||
;;
|
||||
publish-docs)
|
||||
url=${2:-}; [ -n "$url" ] || usage
|
||||
need "$DOCS/book.pdf" "$DOCS/vol1.pdf" "$DOCS/vol2.pdf" "$DOCS/vol3.pdf" "$DOCS/api.pdf"
|
||||
|
||||
Reference in New Issue
Block a user