clone

a personal forge on plain git: static pages, stacked-diff reviews, signed local ci, repo sites and releases

main
forge / test / scenarios / release-page.sh
release-page.sh 2.2K
1# The releases page lists a tag's files: links to the downloads, sizes,2# sha256s, whether SHA256SUMS.sig verifies and whose it is, and the CI of3# the tag's commit. A tag without a release has its notes only.4# The repo has a Releases tab, and its home page links the newest release.5. "$(dirname "$0")/../lib.sh"6user dami7user ana8repo dami/greet9clone dami dami/greet "$T/w/d"10mkdir -p "$T/w/d/.forge"11printf '#!/bin/sh\ntrue\n' >"$T/w/d/.forge/ci"12chmod +x "$T/w/d/.forge/ci"13at "$T/w/d" commit "first"14at "$T/w/d" git tag v015tick 360016at "$T/w/d" commit "second"17at "$T/w/d" git tag v118ok push_as dami "$T/w/d" origin main v019export FORGE_USER=dami20ok at "$T/w/d" "$FORGE" attest v121mkdir "$T/f"22head -c 2500 /dev/zero >"$T/f/greet-linux-amd64"23printf 'notes\n' >"$T/f/notes.txt"24ok at "$T/w/d" "$FORGE" release publish v1 "$T/f/greet-linux-amd64" "$T/f/notes.txt"25unset FORGE_USER26export FORGE_STRICT=127build dami/greet28p=$FORGE_WWW/dami/greet/releases/index.html29has "$p" '<a href="/dami/greet/releases/download/v1/greet-linux-amd64" download>greet-linux-amd64</a></td><td class="size desc">2.4K</td>'30has "$p" "<td class=\"sum mono desc\" title=\"sha256\">$(t_sha256 "$T/f/greet-linux-amd64")</td>"31has "$p" '<a href="/dami/greet/releases/download/v1/notes.txt" download>notes.txt</a>'32has "$p" '<a href="/dami/greet/releases/download/v1/SHA256SUMS" download>SHA256SUMS</a> <span class="ci pass"[^>]*>✓ signed by dami</span>'33has "$p" 'CI of [0-9a-f]{7}: <span class="ci pass">'34# Who built it isn't shown: who signed SHA256SUMS is.35has "$p" 'published '36lacks "$p" 'published [^<]* by '37eq "$(grep -c 'class="downloads"' "$p")" 138has "$p" 'id="v0"'39# A Releases tab (key e), current on this page; the home page links the40# newest release that has files.41has "$p" '<a href="/dami/greet/releases/" data-key="e" class="cur" aria-current="page">releases</a>'42has "$FORGE_WWW/dami/greet/index.html" '<a href="/dami/greet/releases/" data-key="e">releases</a>'43has "$FORGE_WWW/dami/greet/index.html" '<a href="/dami/greet/releases/#v1" title="the latest release: 2 files">release v1</a>'4445# Once dami's key is gone, nobody vouches for SHA256SUMS any more.46ok forge user rm dami47build dami/greet48has "$p" '<span class="ci fail">signature unknown</span>'