From 903468fea8d7ad4cd9212b78ba4529cd82a73a40 Mon Sep 17 00:00:00 2001 From: Peetee06 <17020705+Peetee06@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:37:15 +0000 Subject: [PATCH] Update GitHub Actions workflow for Github Actions brick PR 156 --- .github/workflows/continuous-integration.yml | 39 +++----------------- 1 file changed, 5 insertions(+), 34 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 83e2a8f..79fbaf0 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -5,12 +5,10 @@ permissions: pull-requests: write on: - push: - branches: [develop, staging, master, main] pull_request: env: - FLUTTER_VERSION: "3.24.2" + FLUTTER_VERSION: "stable" jobs: validate: @@ -25,31 +23,11 @@ jobs: cache: true - name: Format run: dart format -o none --set-exit-if-changed lib/ test/ - - name: Build runner - run: dart run build_runner build --delete-conflicting-outputs - name: Analyze run: flutter analyze --fatal-infos --fatal-warnings - determine-flavor: - name: Determine Flavor - runs-on: ubuntu-latest - outputs: - flavor: ${{ steps.set-flavor.outputs.flavor }} - steps: - - name: Determine Flavor - id: set-flavor - run: | - if [[ "${{ github.ref }}" == "refs/heads/master" || "${{ github.ref }}" == "refs/heads/main" ]]; then - echo "flavor=production" >> $GITHUB_OUTPUT - elif [[ "${{ github.ref }}" == "refs/heads/staging" ]]; then - echo "flavor=staging" >> $GITHUB_OUTPUT - else - echo "flavor=development" >> $GITHUB_OUTPUT - fi - build_ios: - name: Build iOS ${{ needs.determine-flavor.outputs.flavor }} - needs: determine-flavor + name: Build iOS runs-on: macos-latest steps: - uses: actions/checkout@v4 @@ -60,14 +38,11 @@ jobs: cache: true - name: Clean run: flutter clean - - name: Build runner - run: dart run build_runner build --delete-conflicting-outputs - name: Build - run: flutter build ios --no-codesign --release --flavor ${{ needs.determine-flavor.outputs.flavor }} -t lib/main_${{ needs.determine-flavor.outputs.flavor }}.dart + run: flutter build ios --no-codesign --release --flavor production -t lib/main_production.dart build_android: - name: Build Android ${{ needs.determine-flavor.outputs.flavor }} - needs: determine-flavor + name: Build Android runs-on: ubuntu-latest env: KEYSTORE_FILENAME: upload-keystore.jks @@ -82,10 +57,8 @@ jobs: run: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 --decode > ./android/app/${{ env.KEYSTORE_FILENAME }} - name: Clean run: flutter clean - - name: Build runner - run: dart run build_runner build --delete-conflicting-outputs - name: Build - run: flutter build appbundle --release --flavor ${{ needs.determine-flavor.outputs.flavor }} -t lib/main_${{ needs.determine-flavor.outputs.flavor }}.dart + run: flutter build appbundle --release --flavor production -t lib/main_production.dart env: ANDROID_KEYSTORE_PATH: ${{ env.KEYSTORE_FILENAME }} ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }} @@ -108,8 +81,6 @@ jobs: sudo apt-get -y install lcov - name: Clean run: flutter clean - - name: Build runner - run: dart run build_runner build --delete-conflicting-outputs - name: Run tests run: flutter test --coverage --file-reporter json:test_results.json - name: Remove generated files from coverage