mirror of
https://github.com/michaelshimeles/paper-rs.git
synced 2026-11-21 20:40:22 +00:00
ec1237453b
scripts/release-macos.sh builds Sketch.app for Apple Silicon and Intel with the MCP stdio bridge inside, signs everything with the hardened runtime, notarizes and staples the app and Sketch.dmg, and writes the zip and signed appcast.xml that Sparkle 2.10.0 installs updates from. The app loads Sparkle at run time once its window is up. Sketch > Check for Updates... checks at once, or opens the latest release in builds without Sparkle. Quitting from the menu, the Dock or an update install never sends CloseRequested, so edits still inside the one-second autosave delay were lost. The app now saves the open project in winit's exiting callback. The release script, fetch-sparkle.sh and the updater module are ported from terminal-rs and glide, other projects by the same author. THIRD_PARTY.md lists them and Sparkle's license, which the app ships in its Resources. The README covers the download, the release script and what has been tested on a Mac. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
1.4 KiB
Bash
Executable File
33 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Downloads Sparkle, the framework that updates an installed copy of the app, into
|
|
# <cargo target dir>/sparkle/<version> (once, checked against the release's SHA-256) and prints
|
|
# that folder. It holds Sparkle.framework, which scripts/release-macos.sh embeds, and
|
|
# bin/sign_update and bin/generate_keys, which it uses to sign the update and its feed.
|
|
#
|
|
# Ported from terminal-rs (scripts/fetch-sparkle.sh), another project by the same author.
|
|
set -euo pipefail
|
|
cd "$(dirname "$0")/.."
|
|
|
|
VERSION=2.10.0
|
|
SHA256=c2bf58aa8387266ac179357b1415d6f2635f044da8be41042af32425dae6da0c
|
|
target_dir=$(cargo metadata --format-version 1 --no-deps | plutil -extract target_directory raw -o - -)
|
|
DIR="$target_dir/sparkle/$VERSION"
|
|
|
|
if [[ ! -d "$DIR/Sparkle.framework" || ! -x "$DIR/bin/sign_update" ]]; then
|
|
TMP="$(mktemp -d)"
|
|
trap 'rm -rf "$TMP"' EXIT
|
|
curl -fsSL --retry 3 -o "$TMP/sparkle.tar.xz" \
|
|
"https://github.com/sparkle-project/Sparkle/releases/download/$VERSION/Sparkle-$VERSION.tar.xz"
|
|
got="$(shasum -a 256 "$TMP/sparkle.tar.xz" | cut -d' ' -f1)"
|
|
if [[ "$got" != "$SHA256" ]]; then
|
|
echo "Sparkle-$VERSION.tar.xz has SHA-256 $got, expected $SHA256" >&2
|
|
exit 1
|
|
fi
|
|
mkdir -p "$TMP/x"
|
|
tar -xf "$TMP/sparkle.tar.xz" -C "$TMP/x" ./Sparkle.framework ./bin/sign_update ./bin/generate_keys ./LICENSE
|
|
rm -rf "$DIR"
|
|
mkdir -p "$(dirname "$DIR")"
|
|
mv "$TMP/x" "$DIR"
|
|
fi
|
|
echo "$DIR"
|