1+
2+ on :
3+ push :
4+ branches :
5+ - main # Trigger on push to the main branch
6+
7+ jobs :
8+ build :
9+ runs-on : macos-latest
10+
11+ steps :
12+ # Step 1: Checkout the repo
13+ - name : Checkout repository
14+ uses : actions/checkout@v2
15+
16+ # Step 2: Set up Flutter
17+ - name : Set up Flutter
18+ uses : subosito/flutter-action@v2
19+ with :
20+ flutter-version : ' stable'
21+
22+ # Step 3: Update Info.plist file
23+ - name : Update Info.plist
24+ run : |
25+ /usr/libexec/PlistBuddy -c "Set :VietMapAccessToken ${{ secrets.VIETMAP_API_KEY }}" ios/Runner/Info.plist
26+ /usr/libexec/PlistBuddy -c "Set :VietMapURL ${{ secrets.VIETMAP_STYLE_URL }}" ios/Runner/Info.plist
27+
28+ # Step 4: Install dependencies
29+ - name : Install dependencies
30+ run : flutter pub get
31+
32+ # Step 5: Build iOS app
33+ - name : Build iOS
34+ run : flutter build ipa --release
35+
36+ # Step 6: Install fastlane
37+ - name : Install fastlane
38+ run : sudo gem install fastlane
39+
40+ # Step 7: Create fastlane App Store Connect API key file
41+ - name : Create API key for App Store Connect
42+ run : |
43+ echo "{
44+ \"key_id\": \"$APP_STORE_CONNECT_KEY_ID\",
45+ \"issuer_id\": \"$APP_STORE_CONNECT_ISSUER_ID\",
46+ \"key\": \"$APP_STORE_CONNECT_API_KEY\"
47+ }" > fastlane/AuthKey.p8
48+ # Step 8: Upload to TestFlight using fastlane
49+ - name : Upload to TestFlight
50+ run : |
51+ fastlane pilot upload \
52+ --ipa ./build/ios/ipa/Runner.ipa \
53+ --api_key_path fastlane/AuthKey.p8 \
54+ --skip_submission true \
55+ --skip_waiting_for_build_processing true
0 commit comments