Update CI/CD #11
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
name: Deploy Beta to TestFlight and Play Store | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- 'lib/**' | |
- 'ios/**' | |
- 'android/**' | |
- '.github/workflows/deploy_beta.yml' | |
- 'pubspec.yml' | |
jobs: | |
deploy: | |
runs-on: macos-latest | |
strategy: | |
matrix: | |
platform: [ ios ] #[ ios, android ] | |
fail-fast: false | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Bundle | |
run: cd ./${{ matrix.platform }} && bundle install | |
- name: Setup Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
cache-key: 'flutter-:os:-:channel:-:version:-:arch:' | |
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:arch:' | |
- if: matrix.platform == 'android' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'corretto' | |
java-version: '17' | |
- name: Install Flutter Packages | |
run: | | |
flutter config --no-analytics | |
flutter pub get | |
- if: matrix.platform == 'ios' | |
name: Install CocoaPods | |
run: cd ./ios && pod install | |
- if: matrix.platform == 'ios' | |
name: Add SSH Key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.MATCH_DEPLOY_KEY }} | |
- if: matrix.platform == 'ios' | |
name: Build and Deploy to TestFlight | |
run: | | |
cd ./ios | |
bundle exec fastlane ios_beta | |
env: | |
APP_STORE_CONNECT_API_KEY_ID: ${{ secrets.ASC_KEY_ID }} | |
APP_STORE_CONNECT_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | |
APP_STORE_CONNECT_API_KEY_BASE64: ${{ secrets.ASC_PRIVATE_KEY }} | |
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | |
- if: matrix.platform == 'android' | |
name: Deserialize Keystore File | |
run: cd ./android/app && echo "$ANDROID_KEYSTORE_FILE" | base64 --decode > ./upload-keystore | |
env: | |
ANDROID_KEYSTORE_FILE: ${{ secrets.ANDROID_KEYSTORE_FILE }} | |
- if: matrix.platform == 'android' | |
name: Deploy to Google Play Store | |
run: | | |
cd ./android | |
bundle exec fastlane android_beta | |
env: | |
GOOGLE_PLAY_SERVICE_ACCOUNT_KEY: ${{ secrets.GOOGLE_PLAY_SERVICE_ACCOUNT_KEY }} | |
ANDROID_KEYSTORE_FILE: ./upload-keystore | |
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | |
ANDROID_KEY_ALIAS: ${{ secrets.ANDROID_KEY_ALIAS }} | |
ANDROID_KEY_PASSWORD: ${{ secrets.ANDROID_KEY_PASSWORD }} |