Skip to content

Commit 8ebc576

Browse files
committed
Phase 4: Add GitHub workflow with SPM build matrix
- Updated iOS workflow with matrix build strategy - Tests both CocoaPods and SPM dependency managers - Ensures compatibility with both systems - Added feature branch to workflow triggers
1 parent bddb59a commit 8ebc576

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

.github/workflows/permission_handler_apple.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name: permission_handler_apple
66
# events but only for the main branch
77
on:
88
push:
9-
branches: [main]
9+
branches: [main, feature/spm-support]
1010
paths:
1111
- "permission_handler_apple/**"
1212
- ".github/workflows/permission_handler_apple.yaml"
@@ -28,6 +28,10 @@ jobs:
2828
# should be moved back to `macos-latest` when GitHub Actions images are updated.
2929
runs-on: macos-15
3030

31+
strategy:
32+
matrix:
33+
dependency-manager: [cocoapods, spm]
34+
3135
env:
3236
source-directory: ./permission_handler_apple
3337
example-directory: ./permission_handler_apple/example
@@ -57,7 +61,22 @@ jobs:
5761
run: flutter analyze
5862
working-directory: ${{env.source-directory}}
5963

64+
# Setup dependency manager
65+
- name: Setup dependency manager
66+
run: |
67+
if [ "${{ matrix.dependency-manager }}" = "cocoapods" ]; then
68+
cd ${{env.example-directory}}/ios
69+
if [ -f Podfile.backup ]; then
70+
cp Podfile.backup Podfile
71+
fi
72+
else
73+
cd ${{env.example-directory}}/ios
74+
if [ -f Podfile ]; then
75+
mv Podfile Podfile.disabled
76+
fi
77+
fi
78+
6079
# Build iOS version of the example App
61-
- name: Run iOS build
80+
- name: Run iOS build (${{ matrix.dependency-manager }})
6281
run: flutter build ios --no-codesign --release
6382
working-directory: ${{env.example-directory}}

0 commit comments

Comments
 (0)