Skip to content

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.

Integration lanes: signed like the app, locked down like release.yml (review)

islandmed13e7bb4cb862
diff --git a/.github/workflows/integrations.yml b/.github/workflows/integrations.yml
index cc3104b5..51af0de8 100644
--- a/.github/workflows/integrations.yml
+++ b/.github/workflows/integrations.yml
@@ -2,28 +2,34 @@ name: Integrations
# The integration lanes (docs/design/release-lanes.md §2, docs/releasing.md "Integration releases"): the Blender
# add-on and the Maya script ship when they change, not with the app. A tag blender-vX.Y.Z or maya-vX.Y.Z (on main,
-# whose file carries exactly that version) runs this: checks, the zip(s) and their SHA256SUMS.txt in a GitHub
-# release of that name, never marked latest (the app's releases/latest stays the app), then the website again so
-# its download links name the new release (pages.yml, step "Integration downloads"). No app version, update feed or
-# package changes. What the two sides can read of each other is the bridge manifest's version, not the app's.
+# whose file carries exactly that version) runs this: checks, the zip(s), SHA256SUMS.txt signed with the release key
+# like the app's (they run inside people's Blender and Maya: the same trust), a GitHub release of that name, never
+# marked latest (the app's releases/latest stays the app), then the website again so its download links name the new
+# release (pages.yml, step "Integration downloads"). No app version, update feed or package changes.
+# Locked down like release.yml (tools/release/check_workflows.py): tag pushes only, pinned actions; the signing key
+# only in job sign (environment `release`, whose deployment rule must list these tag patterns besides v*), which
+# can't write; publish re-checks the signature against the key compiled into the app before releasing.
on:
push:
tags: ['blender-v[0-9]*', 'maya-v[0-9]*']
permissions:
- contents: write
- actions: write
+ contents: read
concurrency:
group: integrations-${{ github.ref_name }}
jobs:
- release:
+ build:
runs-on: ubuntu-24.04
+ outputs:
+ lane: ${{ steps.b.outputs.lane }}
+ title: ${{ steps.b.outputs.title }}
steps:
- - uses: actions/checkout@v7
- - name: Check, build
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - id: b
+ name: Check, build, checksums
run: |
tag=$GITHUB_REF_NAME; lane=${tag%%-v*}; V=${tag#*-v}
git fetch -q origin main
@@ -32,24 +38,77 @@ jobs:
case $lane in
blender)
have=$(sed -n 's/^version = "\(.*\)"/\1/p' addons/blender/sculptforge_bridge/blender_manifest.toml)
+ [ "$have" = "$V" ] || { echo "::error::$tag but the manifest says $have: bump it on main first"; exit 1; }
python3 addons/blender/build_addon.py --check --out dist
- [ "$have" != "$V" ] || cp "dist/sculptforge_bridge-$V.zip" dist/sculptforge_bridge.zip
+ cp "dist/sculptforge_bridge-$V.zip" dist/sculptforge_bridge.zip
title="SculptForge Bridge for Blender $V" ;;
maya)
have=$(sed -n 's/^__version__ = "\(.*\)"/\1/p' integrations/maya/sculptforge_maya.py)
+ [ "$have" = "$V" ] || { echo "::error::$tag but the script says $have: bump it on main first"; exit 1; }
python3 -I tests/maya/test_sculptforge_maya.py # mocked maya.cmds
python3 -m zipfile -c dist/sculptforge_maya.zip integrations/maya/sculptforge_maya.py integrations/maya/README.md
title="SculptForge for Maya $V" ;;
+ *) echo "::error::unknown lane $lane"; exit 1 ;;
esac
- [ "$have" = "$V" ] || { echo "::error::$tag but the file says $have: bump it on main first"; exit 1; }
(cd dist && sha256sum * > SHA256SUMS.txt && cat SHA256SUMS.txt)
- { echo "lane=$lane"; echo "title=$title"; } >> "$GITHUB_ENV"
+ { echo "lane=$lane"; echo "title=$title"; } >> "$GITHUB_OUTPUT"
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ with:
+ name: dist
+ path: dist
+
+ sign:
+ needs: build
+ runs-on: ubuntu-24.04
+ environment: release # UPDATE_SIGNING_KEY lives only here (and in member-release)
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
+ with:
+ name: dist
+ path: dist
+ - name: Sign the checksums (the same key and script as the app's releases)
+ env:
+ UPDATE_SIGNING_KEY: ${{ secrets.UPDATE_SIGNING_KEY }}
+ run: |
+ [ -n "$UPDATE_SIGNING_KEY" ] || { echo "::error::no UPDATE_SIGNING_KEY here: nothing is published unsigned"; exit 1; }
+ tools/release/sign_sums.sh dist
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+ with:
+ name: sig
+ path: dist/SHA256SUMS.txt.sig
+
+ publish:
+ needs: [build, sign]
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: write
+ actions: write
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
+ with:
+ name: dist
+ path: dist
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
+ with:
+ name: sig
+ path: dist
+ - name: Re-check the files and the signature against the key compiled into the app
+ run: |
+ (cd dist && sha256sum -c SHA256SUMS.txt)
+ pub=$(sed -n 's/.*kUpdatePublicKeyHex = "\([0-9a-f]\{64\}\)".*/\1/p' src/core/SelfUpdate.h)
+ { printf '302a300506032b6570032100%s' "$pub" | xxd -r -p; } > "$RUNNER_TEMP/pub.der"
+ openssl pkeyutl -verify -pubin -keyform DER -inkey "$RUNNER_TEMP/pub.der" -rawin \
+ -in dist/SHA256SUMS.txt -sigfile dist/SHA256SUMS.txt.sig
- name: Release
env:
GH_TOKEN: ${{ github.token }}
+ LANE: ${{ needs.build.outputs.lane }}
+ TITLE: ${{ needs.build.outputs.title }}
run: |
- notes="$title. Install and use: https://sculptforge.app/guide/$lane.html. Works with SculptForge releases that read bridge manifest version 1 or newer."
- gh release create "$GITHUB_REF_NAME" dist/* --title "$title" --notes "$notes" --latest=false --verify-tag
+ notes="$TITLE. Install and use: https://sculptforge.app/guide/$LANE.html. SHA256SUMS.txt is signed with the SculptForge release key (SHA256SUMS.txt.sig, Ed25519). Works with SculptForge releases that read bridge manifest version 1."
+ gh release create "$GITHUB_REF_NAME" dist/* --title "$TITLE" --notes "$notes" --latest=false --verify-tag
- name: Website (download links name this release)
env:
GH_TOKEN: ${{ github.token }}
diff --git a/docs/releasing.md b/docs/releasing.md
index 54ee9a97..6c1fd14c 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -202,13 +202,19 @@ They have their own versions and ship when they change, not with the app (docs/d
git tag blender-v1.1.0 origin/main && git push origin blender-v1.1.0 # or maya-vX.Y.Z
```
-`.github/workflows/integrations.yml` checks the tag is on main and matches the file, runs the checks, publishes the
-zip(s) and SHA256SUMS.txt as a GitHub release of that name (never "latest": that stays the app), and redeploys the
-website, whose download links then name it (pages.yml, "Integration downloads"). Each app release still carries the
+`.github/workflows/integrations.yml` checks the tag is on main and matches the file, runs the checks, signs
+SHA256SUMS.txt with the release key exactly like an app release (`tools/release/sign_sums.sh`, job `sign` in the
+environment `release`; the add-on runs inside people's Blender and Maya, so it gets the app's trust), re-checks the
+signature against the key compiled into the app, publishes the zip(s), SHA256SUMS.txt and its .sig as a GitHub release
+of that name (never "latest": that stays the app), and redeploys the website, whose download links then name it (pages.yml, "Integration downloads"). Each app release still carries the
add-on and the script as they are on its commit. Compatibility is the bridge manifest's `version` (`VERSION` in
`bridge_protocol.py` and the Maya script; the app checks it in src/io/BlenderBridge.cpp): raise it only for a change the other
side can't read, and both sides already say "update SculptForge" / "update this script" for a newer one.
+One-time setting (the maintainer, GitHub > Settings > Environments > release > Deployment branches and tags): besides
+`v*`, allow the tags `blender-v*` and `maya-v*`. Until then job `sign` is refused and nothing is published (never
+unsigned). `tools/release/check_workflows.py` keeps integrations.yml locked down like release.yml.
+
## MCP registry (by hand, the maintainer's account)
Each release carries the Claude Desktop bundles (`SculptForge-<version>-<os>.mcpb`, tools/release/build_mcpb.py,
diff --git a/tools/release/check_workflows.py b/tools/release/check_workflows.py
index 461a3600..fc911a2e 100755
--- a/tools/release/check_workflows.py
+++ b/tools/release/check_workflows.py
@@ -15,6 +15,9 @@
tools/release/staged_run.py; a publisher doesn't need job verify or re-check the checksums
(tools/release/verify_staged.py); packages.yml reads any secret, or a job of it uploads packages without a
pinned actions/attest-build-provenance step.
+ - integrations.yml (the Blender/Maya lanes) runs on anything but tag pushes, has an unpinned `uses:` or shell
+ tracing, reads a secret other than UPDATE_SIGNING_KEY (in `environment: release`, by a job that can't write), or
+ publishes without re-checking SHA256SUMS.txt.sig against the app's key (openssl pkeyutl -verify).
Plain text parsing (no PyYAML): workflows here keep jobs at two spaces and their keys at four.
"""
@@ -98,6 +101,29 @@ def check(files):
elif job != "sums" and "upload-artifact" in body and paths(body, "path") != paths(body, "subject-path"):
errs.append(f"packages.yml: job {job} attests {sorted(paths(body, 'subject-path'))} but uploads {sorted(paths(body, 'path'))}"
" (verify refuses an unattested file)")
+ it = files.get("integrations.yml")
+ if it is not None:
+ on = it.split("\njobs:")[0]
+ if re.findall(r"secrets\.(\w+)", it) and set(re.findall(r"secrets\.(\w+)", it)) != {"UPDATE_SIGNING_KEY"}:
+ errs.append("integrations.yml: reads a secret other than UPDATE_SIGNING_KEY")
+ ij = jobs(it)
+ for job, lines in ij.items():
+ body = "\n".join(lines)
+ if SIGNING in body and re.search(r"contents:\s*write", body):
+ errs.append(f"integrations.yml: job {job} holds UPDATE_SIGNING_KEY and a GitHub token that can write")
+ if "gh release create" in body and "pkeyutl -verify" not in body:
+ errs.append(f"integrations.yml: job {job} publishes without re-checking the signature (openssl pkeyutl -verify)")
+ if not any(SIGNING in "\n".join(l) for l in ij.values()):
+ errs.append("integrations.yml: no job signs SHA256SUMS.txt (UPDATE_SIGNING_KEY in environment release)")
+ if not re.search(r"^on:\s*\n\s+push:\s*\n\s+tags:", on, re.M) or re.search(
+ r"\b(branches|pull_request|workflow_dispatch|schedule|workflow_run|issue_comment)\b", on):
+ errs.append("integrations.yml: must run on tag pushes only")
+ for n, line in enumerate(it.splitlines(), 1):
+ m = re.match(r"^\s*(?:-\s+)?uses:\s*(\S.*?)\s*$", line)
+ if m and not m.group(1).startswith("./") and not PINNED.match(m.group(1)):
+ errs.append(f"integrations.yml:{n}: `uses: {m.group(1)}` is not pinned to a full commit SHA")
+ if re.search(r"(^|[\s;])set\s+-[a-wyz]*x", line):
+ errs.append(f"integrations.yml:{n}: shell tracing (set -x)")
rel = files.get("release.yml")
if rel is None:
return errs + ["release.yml: missing"]
@@ -196,6 +222,33 @@ jobs:
"""
+INTEGRATIONS = """on:
+ push:
+ tags: ['blender-v[0-9]*']
+permissions:
+ contents: read
+jobs:
+ sign:
+ runs-on: ubuntu-24.04
+ environment: release
+ steps:
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ - env:
+ UPDATE_SIGNING_KEY: ${{ secrets.UPDATE_SIGNING_KEY }}
+ run: tools/release/sign_sums.sh dist
+ publish:
+ needs: sign
+ runs-on: ubuntu-24.04
+ permissions:
+ contents: write
+ steps:
+ - run: openssl pkeyutl -verify -pubin -rawin -in dist/SHA256SUMS.txt -sigfile dist/SHA256SUMS.txt.sig
+ - env:
+ GH_TOKEN: ${{ github.token }}
+ run: gh release create x --latest=false
+"""
+
+
def self_test():
cases = {
"good": ({"release.yml": GOOD}, 0),
@@ -220,6 +273,24 @@ def self_test():
"no publisher": ({"release.yml": GOOD.replace(TOKEN, "github.token")}, 1),
"prt": ({"release.yml": GOOD, "x.yml": "on:\n pull_request_target:\njobs:\n a:\n steps: []\n"}, 1),
"repo-level reader": ({"release.yml": GOOD, "x.yml": f"jobs:\n a:\n env:\n T: ${{{{ {TOKEN} }}}}\n"}, 1),
+ "integrations good": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS}, 0),
+ "integrations unpinned": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ "@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1", "@v7")}, 1),
+ "integrations other secret": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ "github.token", "secrets.REPO_SIGNING_KEY")}, 1),
+ "integrations key outside env": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ " environment: release\n", "")}, 1),
+ "integrations signer can write": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ " environment: release\n", " environment: release\n permissions:\n contents: write\n")}, 1),
+ "integrations unverified publish": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ "openssl pkeyutl -verify", "true")}, 1),
+ "integrations unsigned": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ "secrets.UPDATE_SIGNING_KEY", "github.token")}, 1),
+ "integrations on a branch": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ " tags: ['blender-v[0-9]*']", " branches: [main]")}, 1),
+ "integrations dispatch": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace(
+ "jobs:", " workflow_dispatch:\njobs:", 1)}, 1),
+ "integrations set -x": ({"release.yml": GOOD, "integrations.yml": INTEGRATIONS.replace("run: gh release", "run: set -x; gh release")}, 1),
"env reader ok": ({"release.yml": GOOD, "x.yml": f"jobs:\n a:\n environment: other-env\n env:\n T: ${{{{ {TOKEN} }}}}\n"}, 0),
}
bad = [f"{k}: {check(f)}" for k, (f, n) in cases.items() if bool(check(f)) != bool(n)]