-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create CI/CD build & deploy to testflight
- Loading branch information
1 parent
204fb99
commit de471a1
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
on: | ||
push: | ||
branches: | ||
- main # Trigger on push to the main branch | ||
|
||
jobs: | ||
build: | ||
runs-on: macos-latest | ||
|
||
steps: | ||
# Step 1: Checkout the repo | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
# Step 2: Set up Flutter | ||
- name: Set up Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
flutter-version: 'stable' | ||
|
||
# Step 3: Update Info.plist file | ||
- name: Update Info.plist | ||
run: | | ||
/usr/libexec/PlistBuddy -c "Set :VietMapAccessToken ${{ secrets.VIETMAP_API_KEY }}" ios/Runner/Info.plist | ||
/usr/libexec/PlistBuddy -c "Set :VietMapURL ${{ secrets.VIETMAP_STYLE_URL }}" ios/Runner/Info.plist | ||
# Step 4: Install dependencies | ||
- name: Install dependencies | ||
run: flutter pub get | ||
|
||
# Step 5: Build iOS app | ||
- name: Build iOS | ||
run: flutter build ipa --release | ||
|
||
# Step 6: Install fastlane | ||
- name: Install fastlane | ||
run: sudo gem install fastlane | ||
|
||
# Step 7: Create fastlane App Store Connect API key file | ||
- name: Create API key for App Store Connect | ||
run: | | ||
echo "{ | ||
\"key_id\": \"$APP_STORE_CONNECT_KEY_ID\", | ||
\"issuer_id\": \"$APP_STORE_CONNECT_ISSUER_ID\", | ||
\"key\": \"$APP_STORE_CONNECT_API_KEY\" | ||
}" > fastlane/AuthKey.p8 | ||
# Step 8: Upload to TestFlight using fastlane | ||
- name: Upload to TestFlight | ||
run: | | ||
fastlane pilot upload \ | ||
--ipa ./build/ios/ipa/Runner.ipa \ | ||
--api_key_path fastlane/AuthKey.p8 \ | ||
--skip_submission true \ | ||
--skip_waiting_for_build_processing true |