Branchwell

PulseCanvas / app · pulsecanvas.ai / scripts / package-store-source.sh

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