ci: fix cocoapods install with gem fallback
This commit is contained in:
25
.github/workflows/apple-build.yml
vendored
25
.github/workflows/apple-build.yml
vendored
@@ -28,7 +28,15 @@ jobs:
|
||||
echo "$HOME/flutter/bin" >> $GITHUB_PATH
|
||||
- name: Install deps
|
||||
run: |
|
||||
brew install cocoapods 2>/dev/null || true
|
||||
# Try brew install
|
||||
brew install cocoapods 2>&1 || echo "brew install failed, trying gem"
|
||||
# Verify installation
|
||||
if ! command -v pod &> /dev/null; then
|
||||
echo "pod not found, installing via gem"
|
||||
gem install cocoapods -v 1.14.3
|
||||
fi
|
||||
# Verify again
|
||||
which pod && pod --version
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
- name: Build macOS
|
||||
@@ -54,10 +62,17 @@ jobs:
|
||||
echo "$HOME/flutter/bin" >> $GITHUB_PATH
|
||||
- name: Install deps
|
||||
run: |
|
||||
brew install cocoapods 2>/dev/null || true
|
||||
echo "$(brew --prefix cocoapods 2>/dev/null)/bin" >> $GITHUB_PATH 2>/dev/null || true
|
||||
which pod 2>/dev/null || gem install cocoapods --user-install 2>/dev/null || true
|
||||
echo "$(ruby -e 'puts Gem.user_dir' 2>/dev/null)/bin" >> $GITHUB_PATH 2>/dev/null || true
|
||||
# Try brew install
|
||||
brew install cocoapods 2>&1 || echo "brew install failed, trying gem"
|
||||
# Verify installation
|
||||
if ! command -v pod &> /dev/null; then
|
||||
echo "pod not found, installing via gem"
|
||||
gem install cocoapods -v 1.14.3
|
||||
fi
|
||||
# Add gem bin to PATH
|
||||
echo "$(ruby -e 'puts Gem.user_dir')/bin" >> $GITHUB_PATH
|
||||
# Verify again
|
||||
which pod && pod --version
|
||||
- name: Get dependencies
|
||||
run: flutter pub get
|
||||
- name: Install CocoaPods
|
||||
|
||||
Reference in New Issue
Block a user