PulseCanvas / app · pulsecanvas.ai / scripts / package-store-source.sh
| 1 | #!/bin/bash |
| 2 | set -euo pipefail |
| 3 | cd "$(dirname "$0")/.." |
| 4 | # Never package local preferences, bookmarks, profiles, signing keys or export videos. |
| 5 | mkdir -p .build/store-source "${PULSECANVAS_SOURCE_OUTPUT_DIR:-build/app-store}" |
| 6 | staging_root="$(mktemp -d .build/store-source/package.XXXXXX)" |
| 7 | trap 'rm -rf "$staging_root"' EXIT |
| 8 | stage="$staging_root/PulseCanvas-source" |
| 9 | mkdir -p "$stage" |
| 10 | # Package only committed release sources; omit unrelated in-progress assets. |
| 11 | git archive HEAD Version.xcconfig Localization Sources scripts radio macOS PulseCanvas.xcodeproj PulseCanvasVision.xcodeproj PulseCanvasMobile.xcodeproj visionOS mobile third_party assets packaging Package.swift Package.resolved LICENSE README.md AGENTS.md docs | tar -x -C "$stage" |
| 12 | # Remove generated Python caches if local checks created them. |
| 13 | find "$stage/scripts" -type d -name __pycache__ -prune -exec rm -rf {} + |
| 14 | release_version="$(awk '/^MARKETING_VERSION = / {print $3}' "$stage/Version.xcconfig")" |
| 15 | release_build="$(awk '/^CURRENT_PROJECT_VERSION = / {print $3}' "$stage/macOS/Release.xcconfig")" |
| 16 | revision="$(git rev-parse HEAD)" |
| 17 | # Do not overwrite a source archive previously matched to a submitted build. |
| 18 | archive="${PULSECANVAS_SOURCE_OUTPUT_DIR:-build/app-store}/PulseCanvas-${release_version}-${release_build}-${revision:0:12}-source.tar.gz" |
| 19 | cat > "$stage/BUILD.txt" <<'TXT' |
| 20 | PulseCanvas Studio release source. The shared version is in Version.xcconfig; Mac build number is in macOS/Release.xcconfig. |
| 21 | Apple silicon, macOS 14+, Xcode 27.0, CMake required. |
| 22 | Read LICENSE and docs/app-store/LICENSES.md. Individual assets retain their terms. |
| 23 | Read Sources/PulseCanvas/Resources/ProjectM/Provenance.md for the ISOSCELES credit, |
| 24 | upstream pins, preset/texture manifests and unresolved permissions/store blocker. |
| 25 | The Store edition excludes projectM, its presets/textures and Sparkle. |
| 26 | For the full direct edition, run scripts/build-projectm.sh to extract/rebuild the exact bundled engine and vendor source. |
| 27 | Run scripts/store-release.sh test to rebuild/relink a local sandboxed app with your own Apple Development identity. |
| 28 | Run scripts/build-app.sh for the existing portable development workflow. |
| 29 | Run scripts/build-direct-release.sh for the Sparkle direct edition with your own Developer ID identity. |
| 30 | See docs/DISTRIBUTION.md for edition resources, update signing and notarization requirements. |
| 31 | Changing ProjectM source under .build/projectm/source and rebuilding replaces the shared library. |
| 32 | Resign the entire local build including the nested library; do not disable library validation. |
| 33 | This source snapshot is preparation evidence, not a claim of cleared asset rights or live distribution. |
| 34 | TXT |
| 35 | printf '%s\n' "$revision" > "$stage/REVISION.txt" |
| 36 | python3 "$stage/scripts/preset-provenance.py" |
| 37 | COPYFILE_DISABLE=1 tar -czf "$archive" -C "$staging_root" PulseCanvas-source |
| 38 | python3 scripts/preset-provenance.py --source "$archive" --revision "$revision" |
| 39 | shasum -a 256 third_party/projectm-source.tar.gz "$archive" > "${PULSECANVAS_SOURCE_OUTPUT_DIR:-build/app-store}/source-${release_version}-${release_build}-${revision:0:12}-SHA256.txt" |
| 40 | printf 'Verified source archive: %s\n' "$archive" |