ci: fix cocoapods install with gem fallback
Some checks failed
Build Apple (macOS + iOS) / build-ios (push) Failing after 1m38s
Build Apple (macOS + iOS) / build-macos (push) Failing after 4m48s

This commit is contained in:
2026-04-23 14:10:07 +08:00
parent 089d7d21bf
commit 7cbee6f82a

View File

@@ -28,7 +28,15 @@ jobs:
echo "$HOME/flutter/bin" >> $GITHUB_PATH echo "$HOME/flutter/bin" >> $GITHUB_PATH
- name: Install deps - name: Install deps
run: | 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 - name: Get dependencies
run: flutter pub get run: flutter pub get
- name: Build macOS - name: Build macOS
@@ -54,10 +62,17 @@ jobs:
echo "$HOME/flutter/bin" >> $GITHUB_PATH echo "$HOME/flutter/bin" >> $GITHUB_PATH
- name: Install deps - name: Install deps
run: | run: |
brew install cocoapods 2>/dev/null || true # Try brew install
echo "$(brew --prefix cocoapods 2>/dev/null)/bin" >> $GITHUB_PATH 2>/dev/null || true brew install cocoapods 2>&1 || echo "brew install failed, trying gem"
which pod 2>/dev/null || gem install cocoapods --user-install 2>/dev/null || true # Verify installation
echo "$(ruby -e 'puts Gem.user_dir' 2>/dev/null)/bin" >> $GITHUB_PATH 2>/dev/null || true 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 - name: Get dependencies
run: flutter pub get run: flutter pub get
- name: Install CocoaPods - name: Install CocoaPods