Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into ref/move-update-workf…
Browse files Browse the repository at this point in the history
…low-to-workflows-dir
  • Loading branch information
Peetee06 committed Sep 25, 2024
2 parents 77c4f5d + aec02ab commit 7796967
Showing 1 changed file with 10 additions and 34 deletions.
44 changes: 10 additions & 34 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: "3.24.3"

jobs:
validate:
Expand All @@ -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
Expand All @@ -60,19 +38,21 @@ 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
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
Expand All @@ -82,10 +62,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 }}
Expand All @@ -108,8 +86,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
Expand Down

0 comments on commit 7796967

Please sign in to comment.