.github/workflows/release.yml builds on a pushed v* tag (or by hand) and attaches everything to a
GitHub release, a pre-release while the version is 0.x, with .github/release-notes.md. The
packaging lives in .github/release/package-{linux,macos}.sh so it can be run locally; the
AppImage icon is rendered by solvecraft-cli from the bracket example.
Fixes #32
Co-Authored-By: Claude Opus 5.5 <[email protected]>
36 lines
1.8 KiB
Bash
Executable File
36 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Package the macOS release build: a universal (arm64 + x86_64) SolveCraft.app and CLI in one zip.
|
|
# Usage: .github/release/package-macos.sh <tag> (from the repository root, after building both
|
|
# aarch64-apple-darwin and x86_64-apple-darwin). Writes out/. The app is not signed.
|
|
set -euo pipefail
|
|
tag=${1:?usage: package-macos.sh <tag>}
|
|
version=${tag#v}
|
|
t=${CARGO_TARGET_DIR:-target}
|
|
name="solvecraft-$tag-macos-universal"
|
|
rm -rf stage out && mkdir -p "stage/$name" out
|
|
app="stage/$name/SolveCraft.app"
|
|
mkdir -p "$app/Contents/MacOS"
|
|
lipo -create -output "$app/Contents/MacOS/solvecraft" "$t/aarch64-apple-darwin/release/solvecraft" "$t/x86_64-apple-darwin/release/solvecraft"
|
|
lipo -create -output "stage/$name/solvecraft-cli" "$t/aarch64-apple-darwin/release/solvecraft-cli" "$t/x86_64-apple-darwin/release/solvecraft-cli"
|
|
cat > "$app/Contents/Info.plist" <<PLIST
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
<plist version="1.0">
|
|
<dict>
|
|
<key>CFBundleName</key><string>SolveCraft</string>
|
|
<key>CFBundleDisplayName</key><string>SolveCraft</string>
|
|
<key>CFBundleIdentifier</key><string>io.github.bherbruck.solvecraft</string>
|
|
<key>CFBundleExecutable</key><string>solvecraft</string>
|
|
<key>CFBundlePackageType</key><string>APPL</string>
|
|
<key>CFBundleVersion</key><string>$version</string>
|
|
<key>CFBundleShortVersionString</key><string>$version</string>
|
|
<key>LSMinimumSystemVersion</key><string>11.0</string>
|
|
<key>NSHighResolutionCapable</key><true/>
|
|
</dict>
|
|
</plist>
|
|
PLIST
|
|
cp README.md LICENSE-MIT LICENSE-APACHE NOTICE ATTRIBUTION.md "stage/$name/"
|
|
lipo -info "$app/Contents/MacOS/solvecraft"
|
|
(cd stage && ditto -c -k --keepParent "$name" "../out/$name.zip")
|
|
ls -l out
|