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
scripts/release.sh: resumable release and lockstep (tag, wait, site, feed, guide, AUR and Omarchy with checksums computed here, Homebrew, issue reply drafts), stops with the fix; docs/releasing.md
islandmede867960cac33
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 88789358..bd35f32f 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -69,12 +69,19 @@ All notable changes to SculptForge are listed here. The format follows- SelectRect and SelectLasso (hide / show) ignored symmetry (#51 follow-up): with X / Y / Z on, the mirror image ofthe shape counts as inside too, as with MaskRect and MaskLasso (`hide_rect` / `hide_lasso symmetry=x`).### Changed-- CI is faster with the same tests: compiles go through ccache (saved only by pushes to main and maintainers' own- runs; pull requests only read it; release builds use no cache), `sculptforge_tests` runs as eight parallel shards- (`sculptforge_tests --shard K/N`; every test still runs once, and each now prints its time), ctest runs tests- in parallel (timed measurements alone), and the Windows build compiles one file per core. The Flatpak check- moved to its own workflow that runs when the packaging, the build or the Flatpak-specific code changes, every- night, and for every release.+- Faster CI and releases with the same tests (docs/releasing.md):+ - **Compiler caching:** compiles go through ccache, cached only by pushes to main and maintainers' own runs.+ Pull requests only read the cache, and tags never save one.+ - **Parallel tests:** `sculptforge_tests` runs as eight parallel shards (`sculptforge_tests --shard K/N`; each test+ now prints its time). ctest runs in parallel, with timed measurements and clipboard tests alone. The slowest+ test sets are spread over several free runners.+ - **Skipped work:** website-only pushes skip the build and test jobs.+ - **Build once, promote:** the release packages are built and tested on every push to main (the new Packages+ workflow). A tagged release promotes the packages of the commit it tags instead of building them again.+ - **Smoke tests before publishing:** every package (Windows installer and .zip, .dmg, .deb and AppImage on x86_64+ and arm64, .rpm) is installed on a fresh runner, opens a model, sculpts and saves.+- `scripts/release.sh X.Y.Z` tags, waits and brings the site, update feed, guide, AUR, Homebrew and Omarchy to the+ release, and drafts the issue replies. It is resumable, and stops with the fix when something is wrong.## [0.10.3] - 2026-11-01diff --git a/CONTRIBUTING.md b/CONTRIBUTING.mdindex b764d695..f47fcd9d 100644--- a/CONTRIBUTING.md+++ b/CONTRIBUTING.md@@ -35,7 +35,7 @@ build dependencies. `ctest` runs the unit tests; `cpack` in the build folder mak(`sculptforge_tests_0of8` ...), each with its own temporary folder. Run the binary itself for a quick check:`./build/sculptforge_tests qremesh` runs the tests whose names contain "qremesh", `--shard 1/4` one shard, andeach test prints how long it took.-Releases are built by `.github/workflows/release.yml` when a `v*` tag is pushed.+Releases are built by `.github/workflows/release.yml` when a `v*` tag is pushed; [docs/releasing.md](docs/releasing.md) has the process.### UI tests@@ -54,8 +54,8 @@ take under a second. They use a throwaway settings folder and never touch your othe script and saves `FAIL-line-N.png`, and clicking a missing item lists similarly named items. Clicksscroll panels as needed, and clicking an item a person couldn't reach (off screen) fails. CI runs the UItests on Linux under Xvfb and on Windows with Mesa's software OpenGL, and uploads the screenshots as an-artifact. CI compiles through ccache (see the comment at the top of `.github/workflows/ci.yml`); release builds-don't.+artifact. CI compiles through ccache (see the comment at the top of `.github/workflows/ci.yml`). Releases: see+[docs/releasing.md](docs/releasing.md).### Windows, from Linuxdiff --git a/docs/releasing.md b/docs/releasing.mdnew file mode 100644index 00000000..11ee5493--- /dev/null+++ b/docs/releasing.md@@ -0,0 +1,110 @@+# 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.++## 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.+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.+4. **Packaged-artifact smoke tests** (release.yml `smoke`): every package is installed or unpacked on a fresh runner.+ The app opens a model and sculpts (tests/ui/release_smoke.sfui), and `sculptforge-cli` opens, sculpts, saves and+ reopens (tests/release_smoke.py). This covers the Windows installer and .zip, the .dmg, the .deb and AppImage+ (x86_64 and arm64) and the .rpm. Publishing waits for every one.+5. **Lockstep**: the site, update feed, live guide, AUR, Homebrew and Omarchy all say X.Y.Z, and issue replies are+ drafted. Read the drafts, then post them.++## Build once, promote++A push to main runs CI and Packages. When the tag points at a commit for which both passed on main, the Release+workflow takes **that run's packages unchanged** (it checks the commit, the workflow file and the event). It+smoke-tests them, then publishes. Nothing is compiled again, so a release takes a few minutes. Otherwise (for+example, the tag is on a commit Packages skipped), Release builds the packages itself from the tag.++Two rules make this safe:+- **Compiler caches:** release builds restore main's caches, and nothing run from a tag or a pull request ever saves+ one.+- **Tokens:** only the `publish` job holds a token that can write.++The packages are not signed yet. When signing comes (SignPath for Windows, Apple notarization), it belongs in a step+between smoke and publish that signs the promoted files, so promotion stays valid.++## The script++```sh+scripts/release.sh 0.10.4 # all steps+HIGHLIGHTS=highlights.txt scripts/release.sh 0.10.4 --from site+scripts/release.sh 0.10.4 --only replies+```++| step | does | skips when |+|---|---|---|+| check | gate 2, 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 |+| 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.++## When a step fails++The script stops with a line starting `fix:` and the command to resume (`--from <step>`). Fix that one thing, then+resume. Every step checks what is already done first, so re-running is always safe. Fix problems as they come;+don't pile them up for later.++| failure | do |+|---|---|+| check: a version file or section missing | add it, commit, push main, 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) |+| site: live site still old | check the Website workflow (`gh run list -w pages.yml`) and re-run it |+| omarchy: the PR merged or closed | open a bump PR there and update `OMARCHY_PR` in the script |++**Trying the pipeline without releasing:**++```sh+gh workflow run release.yml -f tag=vX.Y.Z -f dry_run=true+```++Add `-f promote_run=<Packages run id>` to smoke-test the packages of any Packages run, e.g. one dispatched from a+branch. A dry run never publishes.++## Runners++The build and test jobs run on GitHub's standard runners: free and unlimited for this public repository, up to+20 jobs at once (5 macOS). To move them to other runners (bigger GitHub runners, or a provider's), set repository+variables. No workflow edit is needed, and deleting a variable goes back to the default.++| variable | used by | default |+|---|---|---|+| `SF_RUNNER_LINUX` | CI Linux x86_64, VFX and Blender jobs, Flatpak x86_64, Linux smoke tests | `ubuntu-24.04` |+| `SF_RUNNER_LINUX_ARM` | CI Linux ARM64, arm64 VFX and Flatpak, arm64 smoke test | `ubuntu-24.04-arm` |+| `SF_RUNNER_LINUX_OLD` / `SF_RUNNER_LINUX_OLD_ARM` | the .deb / AppImage builds (older glibc on purpose) | `ubuntu-22.04` / `ubuntu-22.04-arm` |+| `SF_RUNNER_MAC` | CI macOS, the .dmg build and smoke test | `macos-15` |+| `SF_RUNNER_WIN` | CI Windows shards, the Windows build and smoke test | `windows-2022` |++Set one with `gh variable set SF_RUNNER_WIN -b <label> -R islandmed/SculptForge`, or under Settings > Secrets and+variables > Actions > Variables.++Some jobs always stay on GitHub's own runners: the ones that read the repository's change list (CI `changes`,+Release `locate`), the required-check result jobs, and `publish`, the only job with a token that can write. Build+and test jobs get no secrets, only a read-only token, so a third-party runner holds nothing that can change the+repository.diff --git a/scripts/release.sh b/scripts/release.shnew file mode 100755index 00000000..b5b5bff1--- /dev/null+++ b/scripts/release.sh@@ -0,0 +1,336 @@+#!/usr/bin/env bash+# SculptForge - open source digital sculpting+# SPDX-License-Identifier: GPL-3.0-or-later+#+# 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")+#+# Steps: check ci tag release site aur brew omarchy replies status+# 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.+# Needs: gh logged in as islandmed (gh auth status), git, curl, python3, sha256sum (or shasum); run it from a clean+# checkout of main. Pushes to main and the tag are made here, so only the release coordinator runs it, after+# Tony's "ship it" for this version.+set -euo pipefail++REPO=islandmed/SculptForge+AUTHOR_NAME=islandmed[email protected] # never a personal address in outside repos+OMARCHY_PR=1800+STEPS=(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' "$*"; }+ok() { printf ' ok: %s\n' "$*"; }+# die "what is wrong" "the exact fix"+die() {+ red "STOPPED at step '$CURRENT': $1"+ printf ' fix: %s\n' "$2" >&2+ printf ' then: scripts/release.sh %s --from %s\n' "$V" "$CURRENT" >&2+ exit 1+}+sha256() { if command -v sha256sum >/dev/null; then sha256sum "$1" | cut -d' ' -f1; else shasum -a 256 "$1" | cut -d' ' -f1; fi; }+commit() { git -c user.name="$AUTHOR_NAME" -c user.email="$AUTHOR_EMAIL" commit -q "$@"; }+gitp() { git -c credential.helper= -c credential.helper='!gh auth git-credential' "$@"; }+confirm() {+ [ -n "${YES:-}" ] && return 0+ read -r -p "$1 [y/N] " a+ [ "$a" = y ] || [ "$a" = Y ]+}++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=+while [ $# -gt 0 ]; do+ case $1 in+ --from) FROM=$2; shift 2 ;;+ --only) ONLY=$2; shift 2 ;;+ --yes) YES=1; shift ;;+ *) echo "unknown argument $1"; exit 2 ;;+ esac+done+T=v$V+CURRENT=setup+work=$(mktemp -d)+trap 'rm -rf "$work"' EXIT+cd "$(git rev-parse --show-toplevel)"++# --- helpers that steps share -------------------------------------------------------------------------------------++on_main() {+ [ "$(git rev-parse --abbrev-ref HEAD)" = main ] || die "this checkout is on $(git rev-parse --abbrev-ref HEAD)" "git switch main (or run from the main worktree)"+ [ -z "$(git status --porcelain --untracked-files=no)" ] || die "uncommitted changes" "commit or stash them first (git status)"+ git fetch -q origin main --tags+ git merge -q --ff-only origin/main 2>/dev/null || die "main has diverged from origin/main" "git log --oneline origin/main...main, then rebase or reset"+}+push_main() {+ gitp push -q origin HEAD:main || die "push to main refused" "git pull --rebase origin main, check the result, run again"+}+release_ready() {+ gh release view "$T" -R "$REPO" --json assets -q '.assets[].name' > "$work/assets" 2>/dev/null ||+ die "no GitHub release $T yet" "run the earlier steps: scripts/release.sh $V --from tag"+ grep -qx SHA256SUMS.txt "$work/assets" || die "release $T has no SHA256SUMS.txt (unfinished)" "re-run the Release workflow: gh workflow run release.yml -R $REPO -f tag=$T"+}+# Downloads one release asset and checks it against SHA256SUMS.txt with a checksum computed here. Prints the sum.+asset_sha() {+ [ -f "$work/SHA256SUMS.txt" ] || gh release download "$T" -R "$REPO" -p SHA256SUMS.txt -D "$work" >/dev/null+ gh release download "$T" -R "$REPO" -p "$1" -D "$work" --clobber >/dev/null+ local mine listed+ mine=$(sha256 "$work/$1")+ listed=$(awk -v f="$1" '$2 == f || $2 == "*"f { print $1 }' "$work/SHA256SUMS.txt")+ [ "$mine" = "$listed" ] || die "$1: computed $mine, SHA256SUMS.txt says ${listed:-nothing}" "investigate before publishing anything; re-run the Release workflow if an upload was cut short"+ echo "$mine"+}+tarball_sha() {+ curl -fsSL "https://github.com/$REPO/archive/refs/tags/$T.tar.gz" -o "$work/src.tar.gz" ||+ 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.+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')+ [ -n "$id" ] || return 1+ status=$(gh run view "$id" -R "$REPO" --json status -q .status)+ if [ "$status" != completed ]; then+ echo " waiting for $wf run $id ..." >&2+ gh run watch "$id" -R "$REPO" --exit-status >/dev/null || true+ fi+ conclusion=$(gh run view "$id" -R "$REPO" --json conclusion -q .conclusion)+ [ "$conclusion" = success ] ||+ die "$wf run $id on $sha: $conclusion (https://github.com/$REPO/actions/runs/$id)" \+ "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"+}++# --- steps --------------------------------------------------------------------------------------------------------++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"+ 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)"+ if git rev-parse -q --verify "refs/tags/$T" >/dev/null && [ "$(git rev-list -n1 "$T")" != "$(git rev-parse HEAD)" ]; then+ die "$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+ ok "version files, CHANGELOG, What's New, metainfo and guide say $V at $(git rev-parse --short HEAD)"+}++step_ci() {+ local sha+ sha=$(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"+ ok "CI passed on $sha"+ if wait_run packages.yml "$sha" >/dev/null; then+ ok "the Packages run passed: the release will promote its tested packages"+ else+ echo " note: no Packages run for $sha (only website or paperwork changed since?): the release builds its own (about 20 min)"+ fi+}++step_tag() {+ if gh api "repos/$REPO/git/ref/tags/$T" >/dev/null 2>&1; then ok "$T is already pushed"; return; fi+ local sha+ sha=$(git rev-parse HEAD)+ confirm "Tag $T at $(git log -1 --format='%h %s' "$sha") and push it? This publishes SculptForge $V." ||+ die "not confirmed" "run again and answer y (or YES=1) once Tony has said ship it for $V"+ git rev-parse -q --verify "refs/tags/$T" >/dev/null || git tag "$T" "$sha"+ gitp push -q origin "$T" || die "pushing $T failed" "git push origin $T (check gh auth status)"+ ok "pushed $T"+}++step_release() {+ if gh release view "$T" -R "$REPO" --json assets -q '.assets[].name' 2>/dev/null | grep -qx SHA256SUMS.txt; then+ ok "release $T is published"+ else+ local id=""+ for _ in $(seq 30); do+ id=$(gh run list -R "$REPO" -w release.yml -b "$T" -L 1 --json databaseId -q '.[0].databaseId')+ [ -n "$id" ] && break+ sleep 10+ done+ [ -n "$id" ] || die "no Release run for $T after 5 minutes" "gh workflow run release.yml -R $REPO -f tag=$T"+ echo " waiting for Release run $id (https://github.com/$REPO/actions/runs/$id) ..."+ gh run watch "$id" -R "$REPO" --exit-status >/dev/null ||+ die "Release run $id failed (https://github.com/$REPO/actions/runs/$id)" \+ "read the failed job; a runner hiccup: gh run rerun $id --failed -R $REPO; a real bug: fix on main, delete the tag (git push origin :$T; git tag -d $T) and release $V again from step check"+ fi+ release_ready+ local n+ n=$(wc -l < "$work/assets")+ [ "$n" -ge 30 ] || die "release $T has only $n assets" "re-run the Release workflow: gh workflow run release.yml -R $REPO -f tag=$T"+ ok "$n assets, SHA256SUMS.txt included"+}++step_site() {+ release_ready+ on_main+ if grep -q "\"version\": \"$V\"" website/latest.json; then+ ok "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"+ python3 - "$V" "$HIGHLIGHTS" <<'PY'+import json, sys+v, 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)}")+with open("website/latest.json", encoding="utf-8") as f:+ feed = json.load(f)+feed["version"], feed["highlights"] = v, lines+with open("website/latest.json", "w", encoding="utf-8") as f:+ json.dump(feed, f, indent=2, ensure_ascii=False)+ f.write("\n")+PY+ sed -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.html+ rm -f website/index.html.bak+ grep -q "\"softwareVersion\": \"$V\"" website/index.html && grep -q "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.html+ commit -m "Website: $V is the current release (feed, download text)"+ push_main+ ok "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 -q "\"version\": \"$V\""; then+ ok "sculptforge.app/latest.json says $V"+ curl -fsSL "https://sculptforge.app/guide/whats-new.html?$(date +%s)" | grep -q "Version $V" ||+ 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"+}++step_aur() {+ release_ready+ on_main+ local sum+ sum=$(tarball_sha)+ if grep -q "^pkgver=$V\$" packaging/arch/PKGBUILD && grep -q "'$sum'" packaging/arch/PKGBUILD; then+ ok "packaging/arch/PKGBUILD already builds $V ($sum)"+ return+ fi+ python3 - "$V" "$sum" <<'PY'+import re, sys+v, s = sys.argv[1], sys.argv[2]+p = "packaging/arch/PKGBUILD"+t = open(p, encoding="utf-8").read()+t = re.sub(r"^pkgver=.*$", f"pkgver={v}", t, count=1, flags=re.M)+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 ||+ 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/PKGBUILD+ commit -m "AUR PKGBUILD builds $V"+ push_main+ ok "PKGBUILD at $V, source checksum $sum (computed here)"+}++step_brew() {+ release_ready+ local have dmg sum+ have=$(gh api repos/islandmed/homebrew-tap/contents/Casks/sculptforge.rb -q .content | base64 -d | sed -n 's/^ *version "\(.*\)"/\1/p')+ if [ "$have" = "$V" ]; then ok "Homebrew cask already at $V"; return; fi+ dmg="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\"" ||+ 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"+ sum=$(tarball_sha)+ if gh api "repos/$owner/omarchy-pkgs/contents/$path?ref=$branch" -q .content | base64 -d | grep -q "^pkgver=$V\$"; then+ ok "Omarchy PR #$OMARCHY_PR already builds $V"+ return+ fi+ gitp clone -q --depth 1 -b "$branch" "https://github.com/$owner/omarchy-pkgs.git" "$work/omarchy"+ python3 - "$V" "$sum" "$work/omarchy/$path" <<'PY'+import re, sys+v, s, p = sys.argv[1:]+t = open(p, encoding="utf-8").read()+t = re.sub(r"^pkgver=.*$", f"pkgver={v}", t, count=1, flags=re.M)+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") ||+ 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"+ ok "Omarchy PR #$OMARCHY_PR builds $V (author $AUTHOR_EMAIL)"+}++step_replies() {+ release_ready+ local 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)+ {+ echo "# Draft replies for SculptForge $V (read, edit, then post by hand; nothing here was posted)"+ echo+ for n in $issues; do+ local title state lines+ read -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)+ echo "## #$n $title ($state)"+ echo+ echo "Fixed in SculptForge $V, out now: https://github.com/$REPO/releases/tag/$T"+ echo "(Help > Check for updates in the app, or https://sculptforge.app/#download)"+ echo+ echo "$lines"+ echo+ echo "Thanks for reporting it. -- the SculptForge developer"+ echo+ done+ } > "$out"+ ok "drafts for $(echo "$issues" | wc -w) issues in $out: read them, then post with gh issue comment / close"+}++step_status() {+ local winget+ winget=$(gh pr view 464465 -R microsoft/winget-pkgs --json state -q .state 2>/dev/null || echo unknown)+ echo " winget-pkgs#464465: $winget (update it once it merges; waits on the CLA)"+ echo " Release: https://github.com/$REPO/releases/tag/$T"+ echo " Remember: post the replies in release-replies-$V.md after reading them, then update the handoff note."+}++started=+for s in "${STEPS[@]}"; do+ [ "$s" = "$FROM" ] && started=1+ if [ -n "$ONLY" ]; then [ "$s" = "$ONLY" ] || continue; else [ -n "$started" ] || continue; fi+ CURRENT=$s+ say "$s"+ "step_$s"+done+[ -n "$started$ONLY" ] || { echo "unknown step $FROM; steps: ${STEPS[*]}"; exit 2; }+say "SculptForge $V: done"