PulseCanvas / app · pulsecanvas.ai / scripts / sign-direct-release.sh
| 1 | #!/bin/bash |
| 2 | set -euo pipefail |
| 3 | cd "$(dirname "$0")/.." |
| 4 | identity="${DEVELOPER_ID_APPLICATION:-Developer ID Application: Protomota, LLC (22HV69L32T)}" |
| 5 | app="${1:-$PWD/build/direct/PulseCanvas Studio.app}" |
| 6 | test -f "$app/Contents/MacOS/PulseCanvas" |
| 7 | # iCloud requires an Apple-issued Developer ID profile. Never silently distribute |
| 8 | # an unentitled app with a sync toggle that cannot connect. |
| 9 | : "${PULSECANVAS_ICLOUD_PROFILE:?Set PULSECANVAS_ICLOUD_PROFILE to the iCloud-enabled Developer ID profile}" |
| 10 | cloud_entitlements="$(dirname "$app")/creators-icloud.entitlements" |
| 11 | python3 scripts/prepare-creators-icloud.py "$app" "$PULSECANVAS_ICLOUD_PROFILE" "$cloud_entitlements" |
| 12 | # Include the installer artwork before the final app signature. |
| 13 | cp packaging/macos/background.tiff "$app/Contents/Resources/PulseCanvasInstallerBackground.tiff" |
| 14 | # Sign inside out. Preserve framework symlinks and sign every nested executable. |
| 15 | framework="$app/Contents/Frameworks/Sparkle.framework/Versions/B" |
| 16 | while IFS= read -r -d '' bundle; do |
| 17 | codesign --force --options runtime --timestamp --sign "$identity" "$bundle" |
| 18 | done < <(find "$framework/XPCServices" -name '*.xpc' -type d -print0) |
| 19 | codesign --force --options runtime --timestamp --sign "$identity" "$framework/Autoupdate" |
| 20 | codesign --force --options runtime --timestamp --sign "$identity" "$framework/Updater.app" |
| 21 | codesign --force --options runtime --timestamp --sign "$identity" "$app/Contents/Frameworks/Sparkle.framework" |
| 22 | codesign --force --options runtime --timestamp --sign "$identity" "$app/Contents/Frameworks/libprojectM.dylib" |
| 23 | codesign --force --options runtime --timestamp --entitlements "$cloud_entitlements" --sign "$identity" "$app" |
| 24 | codesign --verify --deep --strict --verbose=2 "$app" |
| 25 | python3 scripts/preset-provenance.py --app "$app" |
| 26 | printf 'Developer ID signed app: %s\n' "$app" |