fix(release): post-package verification + non-destructive recovery docs

Add codesign --verify --strict --deep + spctl --assess on the extracted
distribution zip inside build_variant() so any seal regression introduced
by ditto / staple / future pipeline tweaks fails the release before users
see "damaged" errors. Document the non-destructive recovery path in
README and explicitly warn against `xattr -rc` and
`codesign --force --deep --sign -` (issue #49 — both corrupt
Sparkle.framework's nested XPC service / Updater.app signatures even
when the outer app remains intact).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Alan Wizemann
2026-04-27 11:40:16 +02:00
parent 80a4d23974
commit e0f0fad192
2 changed files with 29 additions and 0 deletions
+15
View File
@@ -188,6 +188,21 @@ build_variant() {
log "[$label] Package $(basename "$out_zip")"
ditto -c -k --keepParent "$app_path" "$out_zip"
# Post-package verification: extract the actual distribution zip and confirm
# codesign + Gatekeeper still accept it. Catches any regression introduced by
# ditto / staple / future pipeline tweaks before users see "damaged" errors.
# See issue #49 — without this, a broken seal in Sparkle.framework or the
# outer bundle would only surface in user reports.
log "[$label] Post-package signature + Gatekeeper verification"
local verify_dir
verify_dir="$(mktemp -d)"
ditto -xk "$out_zip" "$verify_dir"
codesign --verify --strict --deep --verbose=4 "$verify_dir/Scarf.app" \
|| die "[$label] codesign --verify failed on packaged zip"
spctl --assess --type execute --verbose "$verify_dir/Scarf.app" \
|| die "[$label] spctl --assess failed on packaged zip"
rm -rf "$verify_dir"
}
UNIVERSAL_ZIP="$RELEASE_DIR/Scarf-v${VERSION}-Universal.zip"