-
Notifications
You must be signed in to change notification settings - Fork 5
enh(CI): Unify staging deploys into single dispatch workflow #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,151 @@ | ||||||||||||||
| name: Staging Distribution (Android + iOS) | ||||||||||||||
|
|
||||||||||||||
| on: | ||||||||||||||
| workflow_dispatch: | ||||||||||||||
| inputs: | ||||||||||||||
| platforms: | ||||||||||||||
| description: 'Platforms to distribute' | ||||||||||||||
| required: true | ||||||||||||||
| default: 'both' | ||||||||||||||
| type: choice | ||||||||||||||
| options: | ||||||||||||||
| - android | ||||||||||||||
| - ios | ||||||||||||||
| - both | ||||||||||||||
| release_notes: | ||||||||||||||
| description: 'Release notes' | ||||||||||||||
| required: false | ||||||||||||||
| type: string | ||||||||||||||
|
|
||||||||||||||
| env: | ||||||||||||||
| FLUTTER_VERSION: "3.38.9" | ||||||||||||||
| FLUTTER_CHANNEL: "stable" | ||||||||||||||
| XCODE_VERSION: "26" | ||||||||||||||
| JAVA_VERSION: "17" | ||||||||||||||
| RUBY_VERSION: "3.2" | ||||||||||||||
|
|
||||||||||||||
| jobs: | ||||||||||||||
| android: | ||||||||||||||
| name: Android (Staging → Firebase) | ||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||
| if: contains(github.event.inputs.platforms, 'android') || github.event.inputs.platforms == 'both' | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout code | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Java | ||||||||||||||
| uses: actions/setup-java@v4 | ||||||||||||||
| with: | ||||||||||||||
| distribution: 'temurin' | ||||||||||||||
| java-version: ${{ env.JAVA_VERSION }} | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Flutter | ||||||||||||||
| uses: subosito/flutter-action@v2 | ||||||||||||||
| with: | ||||||||||||||
| flutter-version: ${{ env.FLUTTER_VERSION }} | ||||||||||||||
| channel: ${{ env.FLUTTER_CHANNEL }} | ||||||||||||||
| cache: true | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Ruby | ||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||
| with: | ||||||||||||||
| ruby-version: ${{ env.RUBY_VERSION }} | ||||||||||||||
| bundler-cache: true | ||||||||||||||
| working-directory: android/fastlane | ||||||||||||||
|
|
||||||||||||||
| - name: Install Fastlane gems | ||||||||||||||
| working-directory: android/fastlane | ||||||||||||||
| run: bundle install | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Service Accounts | ||||||||||||||
| env: | ||||||||||||||
| GOOGLE_SERVICES_ACCOUNT_BASE64: ${{ secrets.GOOGLE_SERVICES_ACCOUNT_BASE64 }} | ||||||||||||||
| CREDENTIAL_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | ||||||||||||||
| run: | | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Writing sensitive credentials to the filesystem should be followed by a cleanup step, or better yet, passed via environment variables directly if the CLI supports it. If files are necessary, ensure they are not uploaded as artifacts or left in a shared environment.
Suggested change
|
||||||||||||||
| printf '%s' "$GOOGLE_SERVICES_ACCOUNT_BASE64" | base64 --decode > google_service_account.json | ||||||||||||||
| printf '%s' "$CREDENTIAL_FILE_CONTENT" > service_credentials_content.json | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Android signing keystore | ||||||||||||||
| run: | | ||||||||||||||
| printf '%s' "${{ secrets.ANDROID_KEYSTORE_FILE_BASE64 }}" | base64 --decode > android/key.jks | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Android key.properties | ||||||||||||||
| run: | | ||||||||||||||
| cat <<EOF > android/key.properties | ||||||||||||||
| storePassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||||||||||||||
| keyPassword=${{ secrets.ANDROID_KEYSTORE_PASSWORD }} | ||||||||||||||
| keyAlias=release | ||||||||||||||
| storeFile=../key.jks | ||||||||||||||
| EOF | ||||||||||||||
|
|
||||||||||||||
| - name: Distribute to Firebase App Distribution | ||||||||||||||
| working-directory: android/fastlane | ||||||||||||||
| run: bundle exec fastlane release_play_store_using_firebase release_notes:"${{ github.event.inputs.release_notes }}" | ||||||||||||||
| env: | ||||||||||||||
| APP_PACKAGE_NAME: ${{ vars.APP_PACKAGE_NAME }} | ||||||||||||||
| FIREBASE_APP_ID: ${{ secrets.FIREBASE_APP_ID }} | ||||||||||||||
|
|
||||||||||||||
| ios: | ||||||||||||||
| name: iOS (Staging → TestFlight) | ||||||||||||||
| runs-on: macos-latest | ||||||||||||||
| if: contains(github.event.inputs.platforms, 'ios') || github.event.inputs.platforms == 'both' | ||||||||||||||
|
|
||||||||||||||
| steps: | ||||||||||||||
| - name: Checkout code | ||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Xcode | ||||||||||||||
| uses: maxim-lobanov/setup-xcode@v1 | ||||||||||||||
| with: | ||||||||||||||
| xcode-version: ${{ env.XCODE_VERSION }} | ||||||||||||||
|
|
||||||||||||||
| - name: Restore DerivedData cache | ||||||||||||||
| uses: actions/cache/restore@v4 | ||||||||||||||
| id: cache-deriveddata | ||||||||||||||
| with: | ||||||||||||||
| path: DerivedData | ||||||||||||||
| key: deriveddata-${{ github.run_id }} | ||||||||||||||
| restore-keys: | | ||||||||||||||
| deriveddata- | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Flutter | ||||||||||||||
| uses: subosito/flutter-action@v2 | ||||||||||||||
| with: | ||||||||||||||
| flutter-version: ${{ env.FLUTTER_VERSION }} | ||||||||||||||
| channel: ${{ env.FLUTTER_CHANNEL }} | ||||||||||||||
| cache: true | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Ruby | ||||||||||||||
| uses: ruby/setup-ruby@v1 | ||||||||||||||
| with: | ||||||||||||||
| ruby-version: ${{ env.RUBY_VERSION }} | ||||||||||||||
| bundler-cache: true | ||||||||||||||
| working-directory: ios/fastlane | ||||||||||||||
|
|
||||||||||||||
| - name: Install Fastlane gems | ||||||||||||||
| working-directory: ios/fastlane | ||||||||||||||
| run: bundle install | ||||||||||||||
|
|
||||||||||||||
| - name: Setup SSH Key | ||||||||||||||
| uses: webfactory/ssh-agent@v0.9.0 | ||||||||||||||
| with: | ||||||||||||||
| ssh-private-key: ${{ secrets.MATCH_DEPLOY_KEY }} | ||||||||||||||
|
|
||||||||||||||
| - name: Setup Service Accounts | ||||||||||||||
| env: | ||||||||||||||
| CREDENTIAL_FILE_CONTENT: ${{ secrets.CREDENTIAL_FILE_CONTENT }} | ||||||||||||||
| run: | | ||||||||||||||
| cat <<< "$CREDENTIAL_FILE_CONTENT" > service_credentials_content.json | ||||||||||||||
|
|
||||||||||||||
| - name: Generate code | ||||||||||||||
| run: flutter pub run build_runner build --delete-conflicting-outputs | ||||||||||||||
|
|
||||||||||||||
| - name: Distribute to TestFlight (Staging) | ||||||||||||||
| working-directory: ios/fastlane | ||||||||||||||
| run: bundle exec fastlane release_testflight_staging | ||||||||||||||
| env: | ||||||||||||||
| MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} | ||||||||||||||
| ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} | ||||||||||||||
| ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | ||||||||||||||
| ASC_KEY_P8_BASE64: ${{ secrets.ASC_KEY_P8_BASE64 }} | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -77,9 +77,7 @@ class AppDatabase extends _$AppDatabase with SynchronizerDb { | |||||||||
| await m.createAll(); | ||||||||||
| }, | ||||||||||
| onUpgrade: (Migrator m, int from, int to) async { | ||||||||||
| if (from < 4) { | ||||||||||
| await _schemaUpgrade(m, from, 4); | ||||||||||
| } | ||||||||||
| await _schemaUpgrade(m, from, to); | ||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While refactoring to use dynamic
Suggested change
|
||||||||||
| }, | ||||||||||
| ); | ||||||||||
| } | ||||||||||
|
|
||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Xcode version '26' is invalid. Current stable major versions are 15 or 16. Using an incorrect version will cause the
macos-latestrunner to fail when locating the Xcode installation.