Skip to content

Commit

Permalink
Fix build failure on macOS due to missing Homebrew
Browse files Browse the repository at this point in the history
  • Loading branch information
svc-design committed Oct 15, 2024
1 parent e9a61fb commit 95b9383
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- platform: android
arch: arm64

runs-on: ${{ matrix.platform == 'macos' && matrix.arch == 'arm64' && 'macos-latest' || (matrix.platform == 'ios' && 'macos-latest' || 'ubuntu-latest') }}
runs-on: ${{ matrix.platform == 'macos' && (matrix.arch == 'arm64' ? 'macos-latest' : 'macos-latest') || (matrix.platform == 'ios' && 'macos-latest' || 'ubuntu-latest') }}

env:
PLATFORM: ${{ matrix.platform }}
Expand All @@ -64,7 +64,20 @@ jobs:
- name: Set up Flutter environment for macOS
if: ${{ matrix.platform == 'macos' || matrix.platform == 'ios' }}
run: |
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Set Homebrew path based on architecture
if [[ "${{ matrix.arch }}" == "arm64" ]]; then
eval "$(/opt/homebrew/bin/brew shellenv)" # For Apple Silicon
else
eval "$(/usr/local/bin/brew shellenv)" # For Intel
fi
# Install Flutter
brew install --cask flutter
# Set PATH and check Flutter installation
export PATH="$PATH:/Users/runner/Library/Flutter/bin"
flutter doctor
Expand Down

0 comments on commit 95b9383

Please sign in to comment.