fix: Resolve macOS cross-compilation issues in unified release

- Disable old unified-build.yml workflow (was causing conflicts)
- Create new unified-release.yml with proper platform separation
- macOS builds now run on macOS runners (fixes cross-compilation)
- Linux and Windows builds use Ubuntu with cross-compilation
- Separate build jobs for each platform to prevent cancellation
- Rename workflow to indicate cross-platform support

Platform matrix:
 Linux x64: Ubuntu runner (native)
 Windows x64: Ubuntu runner (cross-compile)
 macOS x64/ARM64: macOS runners (native)
 Android: Ubuntu runner (native)
 Backend: Ubuntu runner (native)

Fixes macOS build failures and prevents other builds from being canceled!
This commit is contained in:
Tomas Dvorak
2026-03-18 14:22:34 +01:00
parent f0b5dae276
commit 403bf01189
3 changed files with 498 additions and 29 deletions
+116 -20
View File
@@ -1,4 +1,4 @@
name: Unified Release
name: Unified Cross-Platform Release
on:
push:
@@ -57,7 +57,7 @@ jobs:
cd swingmusic-android && git fetch --tags && ANDROID_COMMITS=$(git log $LAST_TAG..HEAD --oneline --no-merges 2>/dev/null || echo "") && cd ..
cd src/swingmusic && git fetch --tags && BACKEND_COMMITS=$(git log $LAST_TAG..HEAD --oneline --no-merges 2>/dev/null || echo "") && cd ../..
# Combine all commits for analysis
# Count commit types
ALL_COMMITS="$MAIN_COMMITS $DESKTOP_COMMITS $ANDROID_COMMITS $BACKEND_COMMITS"
MAJOR_COUNT=$(echo "$ALL_COMMITS" | grep -iE "BREAKING CHANGE|major|!:|breaking" | wc -l || echo "0")
@@ -108,9 +108,10 @@ jobs:
echo "New version: $NEW_VERSION ($BUMP_TYPE)"
build-desktop:
name: Build Desktop App
runs-on: ${{ matrix.os }}
# Linux builds (can be cross-compiled)
build-linux-desktop:
name: Build Linux Desktop
runs-on: ubuntu-latest
needs: get-version
if: contains(github.event.inputs.components, 'desktop')
@@ -119,25 +120,14 @@ jobs:
matrix:
include:
- platform: 'linux-x64'
os: ubuntu-latest
rust_target: 'x86_64-unknown-linux-gnu'
- platform: 'win-x64'
os: windows-latest
rust_target: 'x86_64-pc-windows-msvc'
- platform: 'darwin-x64'
os: macos-latest
rust_target: 'x86_64-apple-darwin'
- platform: 'darwin-arm64'
os: macos-latest
rust_target: 'aarch64-apple-darwin'
steps:
- uses: actions/checkout@v4
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Install dependencies (ubuntu)
if: startsWith(matrix.platform, 'linux')
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
@@ -162,7 +152,7 @@ jobs:
npm ci
npm run tauri build -- --target ${{ matrix.rust_target }}
- name: Upload Desktop artifacts
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: desktop-${{ matrix.platform }}
@@ -171,6 +161,110 @@ jobs:
!swingmusic-desktop/target/${{ matrix.rust_target }}/release/bundle/.*/
retention-days: 30
# Windows builds (can be cross-compiled)
build-windows-desktop:
name: Build Windows Desktop
runs-on: ubuntu-latest
needs: get-version
if: contains(github.event.inputs.components, 'desktop')
strategy:
fail-fast: false
matrix:
include:
- platform: 'windows-x64'
rust_target: 'x86_64-pc-windows-gnu'
steps:
- uses: actions/checkout@v4
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Install Windows cross-compilation tools
run: |
sudo apt-get update
sudo apt-get install -y mingw-w64 g++-multilib nsis
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: "swingmusic-desktop -> target"
key: desktop-${{ matrix.platform }}
- name: Install Tauri CLI
run: npm install -g @tauri-apps/cli
- name: Build Desktop App
run: |
cd swingmusic-desktop
npm ci
npm run tauri build -- --target ${{ matrix.rust_target }}
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: desktop-${{ matrix.platform }}
path: |
swingmusic-desktop/target/${{ matrix.rust_target }}/release/bundle/
!swingmusic-desktop/target/${{ matrix.rust_target }}/release/bundle/.*/
retention-days: 30
# macOS builds (must run on macOS runners)
build-macos-desktop:
name: Build macOS Desktop
runs-on: macos-latest
needs: get-version
if: contains(github.event.inputs.components, 'desktop')
strategy:
fail-fast: false
matrix:
include:
- platform: 'macos-x64'
rust_target: 'x86_64-apple-darwin'
- platform: 'macos-arm64'
rust_target: 'aarch64-apple-darwin'
steps:
- uses: actions/checkout@v4
- name: Initialize submodules
run: git submodule update --init --recursive
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.rust_target }}
- name: Rust Cache
uses: swatinem/rust-cache@v2
with:
workspaces: "swingmusic-desktop -> target"
key: desktop-${{ matrix.platform }}
- name: Install Tauri CLI
run: npm install -g @tauri-apps/cli
- name: Build Desktop App
run: |
cd swingmusic-desktop
npm ci
npm run tauri build -- --target ${{ matrix.rust_target }}
- name: Upload macOS artifacts
uses: actions/upload-artifact@v4
with:
name: desktop-${{ matrix.platform }}
path: |
swingmusic-desktop/target/${{ matrix.rust_target }}/release/bundle/
!swingmusic-desktop/target/${{ matrix.rust_target }}/release/bundle/.*/
retention-days: 30
# Android builds
build-android:
name: Build Android App
runs-on: ubuntu-latest
@@ -215,6 +309,7 @@ jobs:
path: swingmusic-android/app/build/outputs/apk/release/*.apk
retention-days: 30
# Backend builds
build-backend:
name: Build Backend
runs-on: ubuntu-latest
@@ -256,10 +351,11 @@ jobs:
path: src/swingmusic/dist/
retention-days: 30
# Create unified release
create-release:
name: Create Unified Release
runs-on: ubuntu-latest
needs: [get-version, build-desktop, build-android, build-backend]
needs: [get-version, build-linux-desktop, build-windows-desktop, build-macos-desktop, build-android, build-backend]
if: success()
steps:
@@ -321,7 +417,7 @@ jobs:
- **Windows**: Download `.exe` installer
- **macOS Intel**: Download `x64.dmg` disk image
- **macOS ARM64**: Download `arm64.dmg` disk image
- **Linux x64**: Choose `.deb`, `.rpm`, or `.AppImage`
- **Linux**: Choose `.deb`, `.rpm`, or `.AppImage`
### 📱 Mobile Application
- **Android**: Download `.apk` file and install