#!/usr/bin/env bash # Package the macOS release build: a universal (arm64 + x86_64) SolveCraft.app in a .dmg (with an # Applications link to drag it onto), and the universal CLI as a plain binary. # Usage: .github/release/package-macos.sh (from the repository root, after building both # aarch64-apple-darwin and x86_64-apple-darwin). Writes out/. Neither is signed. set -euo pipefail tag=${1:?usage: package-macos.sh } version=${tag#v} t=${CARGO_TARGET_DIR:-target} rm -rf stage out && mkdir -p stage/dmg out app="stage/dmg/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 "out/solvecraft-cli-$tag-macos-universal" "$t/aarch64-apple-darwin/release/solvecraft-cli" "$t/x86_64-apple-darwin/release/solvecraft-cli" cat > "$app/Contents/Info.plist" < CFBundleNameSolveCraft CFBundleDisplayNameSolveCraft CFBundleIdentifierio.github.bherbruck.solvecraft CFBundleExecutablesolvecraft CFBundlePackageTypeAPPL CFBundleVersion$version CFBundleShortVersionString$version LSMinimumSystemVersion11.0 NSHighResolutionCapable PLIST lipo -info "$app/Contents/MacOS/solvecraft" ln -s /Applications stage/dmg/Applications hdiutil create -volname "SolveCraft $tag" -srcfolder stage/dmg -ov -format UDZO "out/SolveCraft-$tag-macos-universal.dmg" ls -l out