Skip to content

Commit 66dbc8c

Browse files
committed
chore: test ios ci
1 parent ab63a6f commit 66dbc8c

1 file changed

Lines changed: 58 additions & 0 deletions

File tree

.github/workflows/ios_gen.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Setup Flutter Platforms and Build
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
setup-and-build:
8+
runs-on: macos-latest
9+
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
16+
- name: Setup Flutter
17+
uses: subosito/flutter-action@v2
18+
with:
19+
flutter-version: '3.38.7'
20+
21+
22+
- name: Enable iOS support
23+
run: |
24+
if [ ! -d "ios" ]; then
25+
flutter create --platforms ios .
26+
echo "iOS support enabled"
27+
else
28+
echo "iOS already configured"
29+
fi
30+
31+
32+
- name: Build iOS (debug)
33+
run: |
34+
flutter build ios --debug --no-codesign
35+
echo "iOS build completed"
36+
37+
- name: Check for changes
38+
id: check-changes
39+
run: |
40+
git status --porcelain
41+
if git status --porcelain | grep -q .; then
42+
echo "changes_detected=true" >> $GITHUB_OUTPUT
43+
else
44+
echo "changes_detected=false" >> $GITHUB_OUTPUT
45+
fi
46+
47+
- name: Configure Git
48+
if: steps.check-changes.outputs.changes_detected == 'true'
49+
run: |
50+
git config --global user.name "ILoveScratch"
51+
git config --global user.email "yaowendao2023@qq.com"
52+
53+
- name: Commit and push changes
54+
if: steps.check-changes.outputs.changes_detected == 'true'
55+
run: |
56+
git add .
57+
git commit -m "chore: enable iOS platforms"
58+
git push origin HEAD:${{ github.ref }}

0 commit comments

Comments
 (0)