From e9f5d8bb6dd67ce8cf230db5a9b45836e5e0175d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Forment?= Date: Sun, 1 Mar 2026 21:27:50 +0100 Subject: [PATCH] Fix: GitHub CI --- .github/workflows/release.yml | 14 ++++---- scripts/make-app-bundle.sh | 66 +++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 7 deletions(-) create mode 100755 scripts/make-app-bundle.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4da7558..7bb2400 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,9 +51,6 @@ jobs: with: key: ${{ matrix.target }} - - name: Install cargo-binstall - uses: cargo-bins/cargo-binstall@main - - name: Install dependencies (Linux) if: runner.os == 'Linux' run: | @@ -61,13 +58,12 @@ jobs: sudo apt-get install -y build-essential cmake pkg-config libasound2-dev libclang-dev libjack-dev \ libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev libgl1-mesa-dev \ libx11-dev libx11-xcb-dev libxcursor-dev libxrandr-dev libxi-dev libwayland-dev - cargo binstall -y cargo-bundle || cargo install cargo-bundle + cargo install cargo-bundle - name: Install dependencies (macOS) if: runner.os == 'macOS' run: | brew list cmake &>/dev/null || brew install cmake - cargo binstall -y cargo-bundle || cargo install cargo-bundle - name: Install dependencies (Windows) if: runner.os == 'Windows' @@ -81,8 +77,12 @@ jobs: - name: Build desktop run: cargo build --release --features desktop --bin cagire-desktop --target ${{ matrix.target }} - - name: Bundle desktop app - if: runner.os != 'Windows' + - name: Bundle desktop app (macOS) + if: runner.os == 'macOS' + run: scripts/make-app-bundle.sh ${{ matrix.target }} + + - name: Bundle desktop app (Linux) + if: runner.os == 'Linux' run: cargo bundle --release --features desktop --bin cagire-desktop --target ${{ matrix.target }} - name: Build AppImages (Linux) diff --git a/scripts/make-app-bundle.sh b/scripts/make-app-bundle.sh new file mode 100755 index 0000000..545510e --- /dev/null +++ b/scripts/make-app-bundle.sh @@ -0,0 +1,66 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Usage: scripts/make-app-bundle.sh +# Creates a macOS .app bundle at target//release/bundle/osx/Cagire.app + +if [[ $# -ne 1 ]]; then + echo "Usage: $0 " + exit 1 +fi + +TARGET="$1" +REPO_ROOT="$(git rev-parse --show-toplevel)" +BINARY="$REPO_ROOT/target/$TARGET/release/cagire-desktop" +ICON="$REPO_ROOT/assets/Cagire.icns" +VERSION="0.1.0" + +if [[ ! -f "$BINARY" ]]; then + echo "ERROR: binary not found at $BINARY" + exit 1 +fi + +APP_DIR="$REPO_ROOT/target/$TARGET/release/bundle/osx/Cagire.app" +CONTENTS="$APP_DIR/Contents" +rm -rf "$APP_DIR" +mkdir -p "$CONTENTS/MacOS" "$CONTENTS/Resources" + +cp "$BINARY" "$CONTENTS/MacOS/cagire-desktop" +[[ -f "$ICON" ]] && cp "$ICON" "$CONTENTS/Resources/Cagire.icns" + +cat > "$CONTENTS/Info.plist" < + + + + CFBundleName + Cagire + CFBundleDisplayName + Cagire + CFBundleIdentifier + com.sova.cagire + CFBundleVersion + ${VERSION} + CFBundleShortVersionString + ${VERSION} + CFBundleExecutable + cagire-desktop + CFBundleIconFile + Cagire.icns + CFBundlePackageType + APPL + LSMinimumSystemVersion + 12.0 + NSHighResolutionCapable + + LSApplicationCategoryType + public.app-category.music + NSHumanReadableCopyright + Copyright (c) 2025 Raphaƫl Forment + NSMicrophoneUsageDescription + Cagire needs microphone access for audio input. + + +PLIST + +echo " APP -> $APP_DIR"