Free, open-source 3D sculpting for Linux, macOS and Windows: dense meshes, remeshing, painting, built-in AI (image/text to 3D), Send to Unreal, game-ready LODs, Gaussian splats and OpenUSD.
C++ 3d3d-sculptingcppdear-imguidigital-sculptingfbxgame-developmentgaussian-splattinggltfimage-to-3dmcpopenglopenusdsculptingtext-to-3dunreal-engine
release.sh: one command; step bump sets version files, check verifies every later precondition before the tag
islandmed940be5fc5ae4
diff --git a/REPORT.md b/REPORT.mdnew file mode 100644index 00000000..083bad25--- /dev/null+++ b/REPORT.md@@ -0,0 +1,17 @@+# feat/release-fast++What: scripts/release.sh is one command (`HIGHLIGHTS=f CARD="title|body" scripts/release.sh X.Y.Z --yes`).+- New first step `bump`: sets CMakeLists, CITATION.cff (+date), rez package.py, metainfo `<release>`, CHANGELOG+ [Unreleased] -> [X.Y.Z] - date; optional CARD writes the home page card + lede; rebuilds the guide; commits as+ islandmed; pushes main. Idempotent; writes nothing unless every check passes; refuses without What's New section,+ its sfui expect, or CHANGELOG entries.+- `check` (and bump) run `preflight`: card + lede (shared `card_ok` with step site), HIGHLIGHTS 3-5 lines (until the+ feed says X.Y.Z), site version-text anchors, PKGBUILD format, setup-channels.sh, Homebrew cask readable, Omarchy PR+ open with a sha256sums line, tools installed, gh account.+- pipefail sweep: gh auth/release/brew/omarchy `| grep -q`, replies `| head -3` and no-match grep in `$(...)`.+- Live-site waits: feed 10 min, guide 5 min (was: fail on first check). CI run lookup waits 3 min after bump's push.+- docs/releasing.md updated.++Tests: bash -n; temp clone + temp bare remote, version 9.9.9: stops in <1 s without What's New, without card,+with 2-line or unset HIGHLIGHTS, with bad CARD, with empty [Unreleased] (nothing written); with all inputs bump+pushed to the bare remote in 3.5 s, check passed in 3.4 s, bump re-run was a no-op. Not run for real.diff --git a/docs/releasing.md b/docs/releasing.mdindex 02549ebb..e7f7a1ea 100644--- a/docs/releasing.md+++ b/docs/releasing.md@@ -1,19 +1,28 @@# Releasing SculptForge-One page for whoever coordinates a release. `scripts/release.sh X.Y.Z` does the work; this explains the gates, what-each step does, and how to recover.+One page for whoever coordinates a release. One command does the work:++```sh+HIGHLIGHTS=highlights.txt CARD="Title|<strong>What</strong> users get ..." scripts/release.sh X.Y.Z --yes+```++It either stops within seconds, before anything is tagged, with the fix, or runs through to the end. This page explains+the gates, what each step does, and how to recover.## Gates (in this order; a release never skips one)1. **Merged tree, tested locally**: on main with the branches for this release merged, `ctest --test-dir build -j3`all green.2. **Version and words**:- - the version is set in CMakeLists.txt, CITATION.cff, packaging/rez/package.py and the metainfo `<release>`;- - CHANGELOG has a `## [X.Y.Z] - date` section;- - docs/guide/whats-new.md has `## Version X.Y.Z`, and tests/ui/whats_new.sfui checks it;- - website/guide is rebuilt (`python3 tools/guide/build_site.py`).-- `release.sh` step `check` verifies all of this.+ - written by people, on main before the release: CHANGELOG entries under `[Unreleased]`; docs/guide/whats-new.md+ `## Version X.Y.Z`, with tests/ui/whats_new.sfui expecting it; the home page's "new in X.Y.Z" card and lede (or+ `CARD=`); the 3-5 feed highlights (`HIGHLIGHTS=`);+ - set by step `bump`: the version in CMakeLists.txt, CITATION.cff (with date-released), packaging/rez/package.py+ and the metainfo `<release>`; CHANGELOG `[Unreleased]` becomes `## [X.Y.Z] - date` under a new empty+ `[Unreleased]`; website/guide is rebuilt. Don't bump version files by hand.++ Step `check` verifies all of this, plus what the steps after the tag need (PKGBUILD format, the Homebrew tap, the+ Omarchy PR is open, the home page's version text), so nothing stops after the tag for a reason known before it.3. **CI and Packages green on main** for exactly that commit:- **CI** (ci.yml) runs every test on Linux x86_64 and ARM64, macOS, Windows, the VFX platforms and Blender.- **Packages** (packages.yml) builds every release package the way it ships, with its tests.@@ -45,26 +54,34 @@ between smoke and publish that signs the promoted files, so promotion stays vali## The script```sh-scripts/release.sh 0.10.4 # all steps-HIGHLIGHTS=highlights.txt scripts/release.sh 0.10.4 --from site+HIGHLIGHTS=highlights.txt CARD="Title|html body" scripts/release.sh 0.10.4 --yes # all steps+HIGHLIGHTS=highlights.txt scripts/release.sh 0.10.4 --from site # resumescripts/release.sh 0.10.4 --only replies```+`CARD="title|html body[|lede]"` writes the card at the top of the #whats-new grid (`<h3>title <small>new in+X.Y.Z</small></h3>`, the body and a What's new link) and starts the section lede with `New in X.Y.Z: lede.` (the lede+defaults to the title). It is used only when the card is missing; a hand-written card wins.+| step | does | skips when ||---|---|---|-| check | gate 2, on a clean, up-to-date main, with gh logged in as islandmed | never (read-only) |+| bump | refuses without What's New, its UI test, CHANGELOG entries, the card (or CARD) and HIGHLIGHTS; then sets the version files and CHANGELOG section, writes the card from CARD, rebuilds the guide, commits as islandmed, pushes main | each file already at X.Y.Z |+| check | gate 2 and every precondition of the later steps, on a clean, up-to-date main, with gh logged in as islandmed | never (read-only) || ci | waits for CI and Packages on main's commit; stops if either failed | the tag exists || tag | asks, then tags main and pushes the tag (this publishes) | the tag is on GitHub || release | waits for the Release run, then checks the assets and SHA256SUMS.txt | the release has SHA256SUMS.txt |-| site | update feed (version + your highlights), home page version text, pushes; then checks the live site and guide | latest.json says X.Y.Z |+| site | update feed (version + your highlights), home page version text, pushes; then waits for the live feed (10 min) and guide (5 min) | latest.json says X.Y.Z || aur | packaging/arch/PKGBUILD: pkgver and the source checksum, computed by downloading the tag's tarball | already at X.Y.Z with that checksum || brew | Homebrew cask through tools/publish/setup-channels.sh, after checking the .dmg's checksum here | the cask is at X.Y.Z || omarchy | bumps the PKGBUILD on our branch of omacom/omarchy-pkgs#1800 (author islandmed noreply) | the PR is at X.Y.Z || replies | writes `release-replies-X.Y.Z.md`: a draft per issue named in the CHANGELOG section; posts nothing | never || status | winget PR state, links, reminders | never |-The "new in X.Y.Z" card and lede on the home page, and the 3-5 feed highlights, are writing. The script checks-they exist and stops with the fix if they don't; it never writes them.+The highlights and the card's words are writing: the script never invents them. It checks they exist before+tagging, and writes the card only from the words you pass in CARD.++Scripting rule: under `set -o pipefail`, never end a pipe with `grep -q` or `head` (they close the pipe early and the+writer fails); capture to a variable or file first, or let grep read everything (`grep ... >/dev/null`).## When a step fails@@ -74,7 +91,8 @@ don't pile them up for later.| failure | do ||---|---|-| check: a version file or section missing | add it, commit, push main, resume from check |+| bump/check: What's New, its test, the card or HIGHLIGHTS missing | write it, commit, push main (or pass CARD/HIGHLIGHTS), run again |+| check: a version file missing | run step bump (`--only bump`), then resume from check || ci: a CI or Packages job failed | runner hiccup (network, a timeout): `gh run rerun <id> --failed`. Real failure: fix on a branch, merge, start from check || release: a smoke test failed | the package is broken: fix on main, delete the tag (`git push origin :vX.Y.Z; git tag -d vX.Y.Z`), release again || release: publish failed after smoke passed | `gh workflow run release.yml -f tag=vX.Y.Z` (it promotes the same packages) |diff --git a/scripts/release.sh b/scripts/release.shindex 121d2563..139643c7 100755--- a/scripts/release.sh+++ b/scripts/release.sh@@ -4,12 +4,16 @@## Releases SculptForge X.Y.Z from main and brings every channel to it in lock step (docs/releasing.md).#-# scripts/release.sh X.Y.Z every step, in order-# scripts/release.sh X.Y.Z --from site resume at a step (after fixing what stopped it)-# scripts/release.sh X.Y.Z --only replies one step-# HIGHLIGHTS=notes.txt scripts/release.sh ... the update feed's 3-5 highlight lines (step "site")+# HIGHLIGHTS=notes.txt scripts/release.sh X.Y.Z --yes every step, in order (the normal way: one command)+# scripts/release.sh X.Y.Z --from site resume at a step (after fixing what stopped it)+# scripts/release.sh X.Y.Z --only replies one step+# HIGHLIGHTS=file the update feed's 3-5 highlight lines, one per line (needed until latest.json says X.Y.Z)+# CARD="title|html body[|lede]" writes the home page's "new in X.Y.Z" card and lede if missing (step "bump";+# the lede defaults to the title)#-# Steps: check ci tag release site aur brew omarchy replies status+# Steps: bump check ci tag release site aur brew omarchy replies status+# bump sets every version file, rebuilds the guide and pushes main; check then verifies everything the later steps+# need, so a release either stops in seconds before the tag or runs through to the end.# Each step looks at the live state first and skips what is already done, so running it again is always safe.# When something is wrong it stops and prints the fix; fix it, then run again with --from <that step>.# It never posts issue replies: it writes drafts for a person to read and post.@@ -22,7 +26,7 @@ REPO=islandmed/SculptForgeAUTHOR_NAME=islandmed[email protected] # never a personal address in outside reposOMARCHY_PR=1800-STEPS=(check ci tag release site aur brew omarchy replies status)+STEPS=(bump check ci tag release site aur brew omarchy replies status)red() { printf '\033[1;31m%s\033[0m\n' "$*" >&2; }say() { printf '\033[1m== %s\033[0m\n' "$*"; }@@ -46,7 +50,7 @@ confirm() {V=${1:-}[[ "$V" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "usage: scripts/release.sh X.Y.Z [--from STEP | --only STEP]"; exit 2; }shift-FROM=check ONLY=+FROM=bump ONLY=while [ $# -gt 0 ]; docase $1 in--from) FROM=$2; shift 2 ;;@@ -56,7 +60,10 @@ while [ $# -gt 0 ]; doesacdoneT=v$V+TODAY=$(date +%F)CURRENT=setup+# HIGHLIGHTS may be relative to where the script was started; the script works from the top of the checkout.+case ${HIGHLIGHTS:-} in ''|/*) ;; *) HIGHLIGHTS=$PWD/$HIGHLIGHTS ;; esacwork=$(mktemp -d)trap 'rm -rf "$work"' EXITcd "$(git rev-parse --show-toplevel)"@@ -92,10 +99,16 @@ tarball_sha() {die "can't download the $T source tarball" "check that the tag is pushed: git ls-remote origin $T"sha256 "$work/src.tar.gz"}-# Successful run of a workflow on a push to main for a commit; waits for one in progress.+# Successful run of a workflow on a push to main for a commit; waits for one in progress. The third argument is how+# many 10-second tries a just-pushed commit's run gets to appear (default 1).wait_run() {- local wf=$1 sha=$2 id status conclusion- id=$(gh run list -R "$REPO" -w "$wf" -c "$sha" -e push -b main -L 1 --json databaseId -q '.[0].databaseId')+ local wf=$1 sha=$2 tries=${3:-1} id="" status conclusion+ while :; do+ id=$(gh run list -R "$REPO" -w "$wf" -c "$sha" -e push -b main -L 1 --json databaseId -q '.[0].databaseId')+ tries=$((tries - 1))+ if [ -n "$id" ] || [ "$tries" -le 0 ]; then break; fi+ sleep 10+ done[ -n "$id" ] || return 1status=$(gh run view "$id" -R "$REPO" --json status -q .status)if [ "$status" != completed ]; then@@ -108,21 +121,197 @@ wait_run() {"fix it on a branch, merge to main, then start again from step check (or re-run the run if it was a runner hiccup: gh run rerun $id --failed -R $REPO)"echo "$id"}+# wait_live URL TEXT SECONDS: true once the live page contains TEXT. Pages deploys lag, so it polls every 15 s.+# grep reads the whole page: grep -q would close the pipe early and curl would fail under pipefail.+wait_live() {+ local end=$((SECONDS + $3))+ while :; do+ curl -fsSL "$1?$(date +%s)" 2>/dev/null | grep -F -- "$2" >/dev/null && return 0+ [ "$SECONDS" -lt "$end" ] || return 1+ sleep 15+ done+}+# gh_file OWNER/REPO PATH [REF]: a file's contents from GitHub ("" when it can't be read).+gh_file() { gh api "repos/$1/contents/$2${3:+?ref=$3}" -q .content 2>/dev/null | base64 -d 2>/dev/null || true; }++# --- preconditions: what the steps after the tag need, checked before anything is tagged --------------------------++# The home page's "new in X.Y.Z" card in #whats-new and the "New in X.Y.Z:" start of its lede (both written by people).+card_ok() { grep -qF "<small>new in $V</small>" website/index.html && grep -qF "class=\"section-lede\">New in $V:" website/index.html; }+card_fix="add an <article class=\"card\"> with <h3>... <small>new in $V</small></h3> at the top of the #whats-new grid and start its section-lede with 'New in $V: ...', commit; or run with CARD=\"title|html body\" and step bump writes both"+feed_done() { grep -qF "\"version\": \"$V\"" website/latest.json; }+# HIGHLIGHTS names a file of 3-5 non-empty lines.+highlights_ok() {+ local n+ [ -n "${HIGHLIGHTS:-}" ] && [ -f "$HIGHLIGHTS" ] || return 1+ n=$(grep -c '[^[:space:]]' "$HIGHLIGHTS" || true)+ [ "$n" -ge 3 ] && [ "$n" -le 5 ]+}+highlights_fix="write 3-5 one-line highlights (what users get) to a file and run again with HIGHLIGHTS=that-file"+# The words people write for What's New: the guide section and the UI test that expects it.+words_ok() {+ grep -q "^## Version ${V//./\\.}\$" docs/guide/whats-new.md ||+ die "docs/guide/whats-new.md has no '## Version $V'" "write that section at the top (Help > What's New shows it), commit, push main"+ grep -qF "expect_text \"Version $V\"" tests/ui/whats_new.sfui ||+ die "tests/ui/whats_new.sfui doesn't check Version $V" "update its first expect_text lines to the new section (the version and one line from it), commit, push main"+}+# Everything the steps after the tag need that doesn't depend on the release existing. In mode "bump" a missing+# card is fine when CARD is set (bump writes it).+preflight() {+ local mode=${1:-} t auth pr state owner branch pk+ for t in git gh curl python3 base64 awk; do command -v "$t" >/dev/null || die "$t is not installed" "install $t"; done+ command -v sha256sum >/dev/null || command -v shasum >/dev/null || die "no sha256sum or shasum" "install coreutils"+ auth=$(gh auth status 2>&1 || true)+ grep -q "account $AUTHOR_NAME" <<<"$auth" || die "gh is not logged in as $AUTHOR_NAME" "gh auth login (or gh auth switch -u $AUTHOR_NAME)"+ words_ok+ # site+ if ! card_ok; then+ if [ "$mode" = bump ] && [[ "${CARD:-}" == ?*"|"?* ]]; then+ :+ elif [ -n "${CARD:-}" ]; then+ die "CARD must be \"title|html body\"" "CARD=\"Short title|<strong>What</strong> users get ...\" scripts/release.sh $V --from bump"+ else+ die "website/index.html has no 'new in $V' card and lede in What's new" "$card_fix"+ fi+ fi+ if ! feed_done; then+ highlights_ok || die "HIGHLIGHTS must name a file with 3-5 highlight lines for the update feed (now: '${HIGHLIGHTS:-unset}')" "$highlights_fix"+ fi+ python3 -c 'import json, sys; json.load(open(sys.argv[1]))' website/latest.json 2>/dev/null || die "website/latest.json is not valid JSON" "fix it, commit"+ grep -q '"softwareVersion": "[0-9.]*"' website/index.html && grep -Eq 'Version [0-9]+\.[0-9]+\.[0-9]+\. All builds' website/index.html ||+ die "website/index.html lost the softwareVersion or 'Version X.Y.Z. All builds' text that step site updates" "restore both (git log -p website/index.html), commit"+ # aur+ pk=packaging/arch/PKGBUILD+ grep -q '^pkgver=' "$pk" && grep -q '^pkgrel=' "$pk" && grep -Eq "^sha256sums=\('[0-9a-f]{64}'" "$pk" ||+ die "$pk lacks the pkgver=, pkgrel= or sha256sums=('<64 hex>' line that step aur rewrites" "restore them, commit"+ # brew+ [ -x tools/publish/setup-channels.sh ] || die "tools/publish/setup-channels.sh is missing or not executable" "git checkout origin/main -- tools/publish/setup-channels.sh"+ gh_file islandmed/homebrew-tap Casks/sculptforge.rb | grep '^ *version "' >/dev/null ||+ die "can't read Casks/sculptforge.rb in islandmed/homebrew-tap" "check gh auth status and that the tap exists (YES=1 tools/publish/setup-channels.sh brew sets it up)"+ # omarchy+ pr=$(gh pr view "$OMARCHY_PR" -R omacom/omarchy-pkgs --json state,headRepositoryOwner,headRefName \+ -q '.state + " " + .headRepositoryOwner.login + " " + .headRefName' 2>/dev/null || true)+ read -r state owner branch <<<"$pr" || true+ [ "$state" = OPEN ] || die "omacom/omarchy-pkgs#$OMARCHY_PR is ${state:-unreadable}" "if it merged, open a version-bump PR for pkgbuilds/sculptforge/PKGBUILD there and set OMARCHY_PR in this script; if it was closed, ask Tony"+ gh_file "$owner/omarchy-pkgs" pkgbuilds/sculptforge/PKGBUILD "$branch" | grep -E "^sha256sums=\('[0-9a-f]{64}'" >/dev/null ||+ die "the Omarchy PKGBUILD on $owner/omarchy-pkgs $branch has no sha256sums=('<64 hex>' line" "fix it on that branch"+ ok "What's New, home page card, highlights, PKGBUILD, Homebrew tap and Omarchy PR #$OMARCHY_PR are ready"+}# --- steps --------------------------------------------------------------------------------------------------------+# Sets every version file to X.Y.Z (and writes the home page card from CARD), rebuilds the guide, pushes main.+step_bump() {+ on_main+ preflight bump+ local card="" out+ card_ok || card=${CARD:-}+ out=$(python3 - "$V" "$TODAY" "$card" <<'PY'+import re, sys+v, today, card = sys.argv[1:]+ev = re.escape(v)+new = {}++def load(p):+ return new[p] if p in new else open(p, encoding="utf-8").read()++def fail(msg):+ print(msg)+ sys.exit(1)++def sub1(p, t, pat, rep):+ t2, n = re.subn(pat, rep, t, count=1, flags=re.M)+ if not n:+ fail(f"{p}: no line matching {pat}")+ return t2++p = "CMakeLists.txt"; t = load(p)+if not re.search(rf"^project\(SculptForge VERSION {ev}\b(?!\.)", t, re.M):+ new[p] = sub1(p, t, r"^(project\(SculptForge VERSION )[0-9]+(?:\.[0-9]+)*", rf"\g<1>{v}")++p = "CITATION.cff"; t = load(p)+if not re.search(rf"^version: {ev}$", t, re.M):+ t = sub1(p, t, r"^version: .*$", f"version: {v}")+ new[p] = sub1(p, t, r"^date-released: .*$", f"date-released: {today}")++p = "packaging/rez/package.py"; t = load(p)+if not re.search(rf'^version = "{ev}"', t, re.M):+ new[p] = sub1(p, t, r'^version = ".*"', f'version = "{v}"')++p = "packaging/linux/org.sculptforge.SculptForge.metainfo.xml"; t = load(p)+if f'<release version="{v}"' not in t:+ new[p] = sub1(p, t, r"^([ \t]*)<releases>[ \t]*\n", rf'\g<0>\g<1> <release version="{v}" date="{today}"/>\n')++p = "CHANGELOG.md"; t = load(p)+if not re.search(rf"^## \[{ev}\]", t, re.M):+ m = re.search(r"^## \[Unreleased\][^\n]*\n", t, re.M)+ if not m:+ fail(f"{p} has no '## [Unreleased]' section to release")+ nxt = re.search(r"^## \[", t[m.end():], re.M)+ body = t[m.end():m.end() + nxt.start()] if nxt else t[m.end():]+ if not body.strip():+ fail(f"{p}: [Unreleased] is empty, so there is nothing to release as {v}")+ new[p] = t[:m.start()] + f"## [Unreleased]\n\n## [{v}] - {today}\n" + t[m.end():]++if card:+ title, body, *rest = [s.strip() for s in card.split("|", 2)]+ lede = (rest[0] if rest else re.sub(r"<[^>]+>", "", title)).rstrip(".")+ p = "website/index.html"; t = load(p)+ s = t.find('<section id="whats-new"')+ if s < 0:+ fail(f"{p} has no <section id=\"whats-new\">")+ if f"<small>new in {v}</small>" not in t:+ g = t.find('<div class="grid">', s)+ if g < 0:+ fail(f"{p}: no <div class=\"grid\"> in #whats-new")+ at = t.index("\n", g) + 1+ link = "" if "guide/whats-new.html" in body else ' <a href="guide/whats-new.html">What\'s new</a>'+ t = (t[:at] + ' <article class="card">\n'+ f" <h3>{title} <small>new in {v}</small></h3>\n"+ f" <p>{body}{link}</p>\n"+ " </article>\n" + t[at:])+ tag = '<p class="section-lede">'+ if f"{tag}New in {v}:" not in t:+ l = t.find(tag, s)+ if l < 0:+ fail(f"{p}: no section-lede paragraph in #whats-new")+ l += len(tag)+ t = t[:l] + f"New in {v}: {lede}. " + t[l:]+ mm = ".".join(v.split(".")[:2])+ t = re.sub(r"(<h2>What's new in )[0-9.]+(</h2>)", rf"\g<1>{mm}\g<2>", t, count=1)+ t = re.sub(r'(class="new-badge"[^>]*><span>New in )[0-9.]+(</span>)', rf"\g<1>{mm}\g<2>", t, count=1)+ new[p] = t++for p, t in new.items(): # written only after every check passed, so a failure leaves the tree clean+ open(p, "w", encoding="utf-8").write(t)+ print(p)+PY+) || die "$out" "fix that file by hand (CHANGELOG entries and What's New are written by people), commit, push main"+ [ -n "$out" ] && echo "$out" | sed 's/^/ set: /'+ card_ok || die "the card and lede written from CARD don't pass the check" "git checkout -- . and add them by hand: $card_fix"+ python3 tools/guide/build_site.py >/dev/null+ git add CMakeLists.txt CITATION.cff packaging/rez/package.py packaging/linux/org.sculptforge.SculptForge.metainfo.xml CHANGELOG.md website/index.html+ git add -A website/guide+ if git diff --cached --quiet; then+ ok "every version file already says $V and the guide is built"+ return+ fi+ commit -m "Release $V: version files, CHANGELOG section, guide"+ push_main+ ok "version files at $V, guide rebuilt, pushed main $(git rev-parse --short HEAD)"+}+step_check() {on_main- gh auth status 2>&1 | grep -q "account $AUTHOR_NAME" || die "gh is not logged in as $AUTHOR_NAME" "gh auth login (or gh auth switch -u $AUTHOR_NAME)"- grep -q "^project(SculptForge VERSION $V" CMakeLists.txt || die "CMakeLists.txt is not at $V" "set project(SculptForge VERSION $V ...) and commit"- grep -q "^## \[$V\]" CHANGELOG.md || die "CHANGELOG.md has no '## [$V] - date' section" "rename [Unreleased] to [$V] - $(date +%F) (keep an empty [Unreleased] above it) and commit"- grep -q "^## Version $V\$" docs/guide/whats-new.md || die "docs/guide/whats-new.md has no '## Version $V'" "add the section (Help > What's New shows it) and commit"- grep -q "expect_text \"Version $V\"" tests/ui/whats_new.sfui || die "tests/ui/whats_new.sfui doesn't check Version $V" "update its expect_text lines to the new section and commit"- grep -q "<release version=\"$V\"" packaging/linux/org.sculptforge.SculptForge.metainfo.xml || die "metainfo has no <release version=\"$V\">" "add <release version=\"$V\" date=\"$(date +%F)\"/> at the top of <releases> and commit"- grep -q "^version: $V\$" CITATION.cff || die "CITATION.cff is not at $V" "set version: $V and commit"- grep -q "^version = \"$V\"" packaging/rez/package.py || die "packaging/rez/package.py is not at $V" "set version = \"$V\" and commit"+ preflight+ local bump="run step bump: scripts/release.sh $V --only bump (it sets every version file)"+ grep -q "^project(SculptForge VERSION ${V//./\\.}[ )]" CMakeLists.txt || die "CMakeLists.txt is not at $V" "$bump"+ grep -q "^## \[${V//./\\.}\]" CHANGELOG.md || die "CHANGELOG.md has no '## [$V] - date' section" "$bump"+ grep -qF "<release version=\"$V\"" packaging/linux/org.sculptforge.SculptForge.metainfo.xml || die "metainfo has no <release version=\"$V\">" "$bump"+ grep -qx "version: $V" CITATION.cff || die "CITATION.cff is not at $V" "$bump"+ grep -qx "version = \"$V\"" packaging/rez/package.py || die "packaging/rez/package.py is not at $V" "$bump"python3 tools/guide/build_site.py >/dev/null- git diff --quiet -- website/guide || die "website/guide is not rebuilt from docs/guide" "git add website/guide && git commit -m 'Guide: rebuilt for $V' (build_site.py just rebuilt it)"+ [ -z "$(git status --porcelain -- website/guide)" ] || die "website/guide is not rebuilt from docs/guide" "$bump"if git rev-parse -q --verify "refs/tags/$T" >/dev/null && [ "$(git rev-list -n1 "$T")" != "$(git rev-parse HEAD)" ]; thendie "$T already tags $(git rev-list -n1 "$T"), not main's $(git rev-parse --short HEAD)" "if that is the release, continue: scripts/release.sh $V --from release; if not, pick the next version"fi@@ -133,7 +322,8 @@ step_ci() {local shasha=$(git rev-parse HEAD)if git rev-parse -q --verify "refs/tags/$T" >/dev/null; then ok "$T is tagged: CI was checked before tagging"; return; fi- wait_run ci.yml "$sha" >/dev/null || die "no CI run on main for $sha" "push main first (git push origin main), or wait a minute for the run to start, then run again"+ # bump may have pushed a moment ago: give the run 3 minutes to appear+ wait_run ci.yml "$sha" 18 >/dev/null || die "no CI run on main for $sha after 3 minutes" "push main first (git push origin main), or check Actions, then run again"ok "CI passed on $sha"if wait_run packages.yml "$sha" >/dev/null; thenok "the Packages run passed: the release will promote its tested packages"@@ -154,7 +344,9 @@ step_tag() {}step_release() {- if gh release view "$T" -R "$REPO" --json assets -q '.assets[].name' 2>/dev/null | grep -qx SHA256SUMS.txt; then+ local assets+ assets=$(gh release view "$T" -R "$REPO" --json assets -q '.assets[].name' 2>/dev/null || true)+ if grep -qx SHA256SUMS.txt <<<"$assets"; thenok "release $T is published"elselocal id=""@@ -179,19 +371,17 @@ step_release() {step_site() {release_readyon_main- if grep -q "\"version\": \"$V\"" website/latest.json; then+ if feed_done; thenok "website/latest.json already says $V"else- [ -n "${HIGHLIGHTS:-}" ] && [ -f "$HIGHLIGHTS" ] ||- die "the update feed needs this release's highlights" "write 3-5 one-line highlights (what users get) to a file and run: HIGHLIGHTS=that-file scripts/release.sh $V --from site"- grep -q "new in $V" website/index.html ||- die "website/index.html has no 'new in $V' card in What's new" "add an <article class=\"card\"> with <small>new in $V</small> at the top of the #whats-new grid and 'New in $V: ...' at the start of its lede, commit, run again"+ highlights_ok || die "the update feed needs this release's highlights" "$highlights_fix --from site"+ card_ok || die "website/index.html has no 'new in $V' card and lede in What's new" "$card_fix"python3 - "$V" "$HIGHLIGHTS" <<'PY'import json, sysv, notes = sys.argv[1], sys.argv[2]lines = [l.strip() for l in open(notes, encoding="utf-8") if l.strip()]-if not 1 <= len(lines) <= 6:- sys.exit(f"{notes}: want 1-6 highlight lines, found {len(lines)}")+if not 3 <= len(lines) <= 5:+ sys.exit(f"{notes}: want 3-5 highlight lines, found {len(lines)}")with open("website/latest.json", encoding="utf-8") as f:feed = json.load(f)feed["version"], feed["highlights"] = v, lines@@ -201,7 +391,7 @@ with open("website/latest.json", "w", encoding="utf-8") as f:PYsed -i.bak -E "s/\"softwareVersion\": \"[0-9.]+\"/\"softwareVersion\": \"$V\"/; s/Version [0-9]+\.[0-9]+\.[0-9]+\. All builds/Version $V. All builds/" website/index.htmlrm -f website/index.html.bak- grep -q "\"softwareVersion\": \"$V\"" website/index.html && grep -q "Version $V. All builds" website/index.html ||+ grep -qF "\"softwareVersion\": \"$V\"" website/index.html && grep -qF "Version $V. All builds" website/index.html ||die "website/index.html's version text didn't update" "set softwareVersion and the 'Version X.Y.Z. All builds' line by hand, commit, run again"git add website/latest.json website/index.htmlcommit -m "Website: $V is the current release (feed, download text)"@@ -209,17 +399,12 @@ PYok "pushed the feed and home page"fi# The Website workflow deploys main's site and the newest tag's guide; check what visitors get.- for _ in $(seq 40); do- if curl -fsSL "https://sculptforge.app/latest.json?$(date +%s)" | grep "\"version\": \"$V\"" >/dev/null; then- ok "sculptforge.app/latest.json says $V"- curl -fsSL "https://sculptforge.app/guide/whats-new.html?$(date +%s)" | grep "Version $V" >/dev/null ||- die "the live guide's What's New doesn't show $V" "gh workflow run pages.yml -R $REPO (it takes the guide from the newest tag), wait, run again"- ok "the live guide shows Version $V"- return- fi- sleep 15- done- die "sculptforge.app still serves the old feed after 10 minutes" "check the Website workflow: gh run list -R $REPO -w pages.yml -L 3; re-run it if it failed"+ wait_live https://sculptforge.app/latest.json "\"version\": \"$V\"" 600 ||+ die "sculptforge.app still serves the old feed after 10 minutes" "check the Website workflow: gh run list -R $REPO -w pages.yml -L 3; re-run it if it failed"+ ok "sculptforge.app/latest.json says $V"+ wait_live https://sculptforge.app/guide/whats-new.html "Version $V" 300 ||+ die "the live guide's What's New still doesn't show $V after 5 minutes" "gh workflow run pages.yml -R $REPO (it takes the guide from the newest tag), wait, run again"+ ok "the live guide shows Version $V"}step_aur() {@@ -227,7 +412,7 @@ step_aur() {on_mainlocal sumsum=$(tarball_sha)- if grep -q "^pkgver=$V\$" packaging/arch/PKGBUILD && grep -q "'$sum'" packaging/arch/PKGBUILD; then+ if grep -q "^pkgver=$V\$" packaging/arch/PKGBUILD && grep -qF "'$sum'" packaging/arch/PKGBUILD; thenok "packaging/arch/PKGBUILD already builds $V ($sum)"returnfi@@ -241,7 +426,7 @@ t = re.sub(r"^pkgrel=.*$", "pkgrel=1", t, count=1, flags=re.M)t = re.sub(r"^sha256sums=\('[0-9a-f]{64}'", f"sha256sums=('{s}'", t, count=1, flags=re.M)open(p, "w", encoding="utf-8").write(t)PY- grep -q "^pkgver=$V\$" packaging/arch/PKGBUILD && grep -q "'$sum'" packaging/arch/PKGBUILD ||+ grep -q "^pkgver=$V\$" packaging/arch/PKGBUILD && grep -qF "'$sum'" packaging/arch/PKGBUILD ||die "couldn't update packaging/arch/PKGBUILD" "set pkgver=$V, pkgrel=1 and the first sha256sums entry to $sum by hand, commit, run again"git add packaging/arch/PKGBUILDcommit -m "AUR PKGBUILD builds $V"@@ -252,24 +437,25 @@ PYstep_brew() {release_readylocal have dmg sum- have=$(gh api repos/islandmed/homebrew-tap/contents/Casks/sculptforge.rb -q .content | base64 -d | sed -n 's/^ *version "\(.*\)"/\1/p')+ have=$(gh_file islandmed/homebrew-tap Casks/sculptforge.rb | sed -n 's/^ *version "\(.*\)"/\1/p')if [ "$have" = "$V" ]; then ok "Homebrew cask already at $V"; return; fidmg="SculptForge-$V-darwin-universal.dmg"sum=$(asset_sha "$dmg")YES=1 tools/publish/setup-channels.sh brew >/dev/null || die "tools/publish/setup-channels.sh brew failed" "run it by hand to see why: YES=1 tools/publish/setup-channels.sh brew"- gh api repos/islandmed/homebrew-tap/contents/Casks/sculptforge.rb -q .content | base64 -d | grep -q "sha256 \"$sum\"" ||+ gh_file islandmed/homebrew-tap Casks/sculptforge.rb | grep -F "sha256 \"$sum\"" >/dev/null ||die "the cask doesn't carry the checksum computed here ($sum)" "compare Casks/sculptforge.rb in islandmed/homebrew-tap with $dmg's real checksum and fix it"ok "Homebrew cask at $V ($sum)"}step_omarchy() {release_ready- local state branch owner path=pkgbuilds/sculptforge/PKGBUILD sum- read -r state owner branch < <(gh pr view "$OMARCHY_PR" -R omacom/omarchy-pkgs --json state,headRepositoryOwner,headRefName \- -q '.state + " " + .headRepositoryOwner.login + " " + .headRefName')- [ "$state" = OPEN ] || die "omacom/omarchy-pkgs#$OMARCHY_PR is $state" "if it merged, open a version-bump PR for $path there and set OMARCHY_PR in this script; if it was closed, ask Tony"+ local state branch owner path=pkgbuilds/sculptforge/PKGBUILD sum pr+ pr=$(gh pr view "$OMARCHY_PR" -R omacom/omarchy-pkgs --json state,headRepositoryOwner,headRefName \+ -q '.state + " " + .headRepositoryOwner.login + " " + .headRefName' 2>/dev/null || true)+ read -r state owner branch <<<"$pr" || true+ [ "$state" = OPEN ] || die "omacom/omarchy-pkgs#$OMARCHY_PR is ${state:-unreadable}" "if it merged, open a version-bump PR for $path there and set OMARCHY_PR in this script; if it was closed, ask Tony"sum=$(tarball_sha)- if gh api "repos/$owner/omarchy-pkgs/contents/$path?ref=$branch" -q .content | base64 -d | grep -q "^pkgver=$V\$"; then+ if gh_file "$owner/omarchy-pkgs" "$path" "$branch" | grep -x "pkgver=$V" >/dev/null; thenok "Omarchy PR #$OMARCHY_PR already builds $V"returnfi@@ -283,7 +469,7 @@ t = re.sub(r"^pkgrel=.*$", "pkgrel=1", t, count=1, flags=re.M)t = re.sub(r"^sha256sums=\('[0-9a-f]{64}'", f"sha256sums=('{s}'", t, count=1, flags=re.M)open(p, "w", encoding="utf-8").write(t)PY- (cd "$work/omarchy" && grep -q "^pkgver=$V\$" "$path" && grep -q "'$sum'" "$path") ||+ (cd "$work/omarchy" && grep -q "^pkgver=$V\$" "$path" && grep -qF "'$sum'" "$path") ||die "couldn't update the Omarchy PKGBUILD" "edit $path on $owner/omarchy-pkgs branch $branch by hand (pkgver=$V, first sha256 $sum)"(cd "$work/omarchy" && git add "$path" && commit -m "sculptforge $V" && gitp push -q origin "HEAD:$branch") ||die "pushing to $owner/omarchy-pkgs $branch failed" "check gh auth status, then run again"@@ -293,7 +479,8 @@ PYstep_replies() {release_readylocal out="release-replies-$V.md" issues- issues=$(awk "/^## \[$V\]/{f=1;next} /^## \[/{f=0} f" CHANGELOG.md | grep -o '#[0-9]\+' | tr -d '#' | sort -un)+ awk -v h="## [$V]" 'index($0, h) == 1 {f = 1; next} /^## \[/ {f = 0} f' CHANGELOG.md > "$work/section"+ issues=$(grep -o '#[0-9]\+' "$work/section" | tr -d '#' | sort -un || true) # no issues named is fine{echo "# Draft replies for SculptForge $V (read, edit, then post by hand; nothing here was posted)"echo@@ -301,7 +488,7 @@ step_replies() {local title state linesread -r state title < <(gh issue view "$n" -R "$REPO" --json state,title -q '.state + " " + .title' 2>/dev/null || echo "MISSING ?")[ "$state" = MISSING ] && continue- lines=$(awk "/^## \[$V\]/{f=1;next} /^## \[/{f=0} f" CHANGELOG.md | grep "#$n\b" | sed 's/^- //' | head -3)+ lines=$(grep -m3 "#$n\b" "$work/section" | sed 's/^- //' || true)echo "## #$n $title ($state)"echoecho "Fixed in SculptForge $V, out now: https://github.com/$REPO/releases/tag/$T"