Skip to content

Commit

Permalink
feat: create CI/CD build & deploy to testflight
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhdang198 committed Sep 24, 2024
1 parent 204fb99 commit de471a1
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/build_ios_testflight.yml
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

0 comments on commit de471a1

Please sign in to comment.