Feat: overhaul to produce .dmg and .app on macOS build script

This commit is contained in:
2026-02-28 03:15:51 +01:00
parent 730ddfb716
commit 7099501130
6 changed files with 136 additions and 1 deletions

View File

@@ -229,6 +229,14 @@ bundle_plugins_native() {
cargo xtask bundle "$PLUGIN_NAME" --release $tf
}
bundle_desktop_native() {
local platform="$1"
local tf
tf=$(target_flag "$platform")
# shellcheck disable=SC2086
cargo bundle --release --features desktop --bin cagire-desktop $tf
}
bundle_plugins_cross() {
local platform="$1"
local rd
@@ -300,6 +308,18 @@ copy_artifacts() {
local dst="$OUT/cagire-desktop-${os}-${arch}${suffix}"
cp "$src" "$dst"
echo " cagire-desktop -> $dst"
# macOS .app bundle
if [[ "$os" == "macos" ]]; then
local app_src="$rd/bundle/osx/Cagire.app"
if [[ -d "$app_src" ]]; then
local app_dst="$OUT/Cagire-${arch}.app"
rm -rf "$app_dst"
cp -R "$app_src" "$app_dst"
echo " Cagire.app -> $app_dst"
scripts/make-dmg.sh "$app_dst" "$OUT"
fi
fi
fi
# AppImage for Linux targets
@@ -407,6 +427,10 @@ for platform in "${selected_platforms[@]}"; do
if $build_desktop; then
echo " -> cagire-desktop"
build_binary "$platform" --features desktop --bin cagire-desktop
if ! is_cross_target "$platform"; then
echo " -> bundling cagire-desktop .app"
bundle_desktop_native "$platform"
fi
fi
if $build_plugins; then