1414 runs-on : ubuntu-latest
1515
1616 steps :
17- # Step 1: Maximize disk space for the build process
17+ # Standard cleanup to ensure enough disk space
1818 - name : Free Disk Space (Ubuntu)
1919 uses : jlumbroso/free-disk-space@main
2020 with :
@@ -26,68 +26,43 @@ jobs:
2626 docker-images : true
2727 swap-storage : true
2828
29- # Step 2: Checkout the code
3029 - name : Checkout Code
3130 uses : actions/checkout@v4
3231 with :
3332 fetch-depth : 0
3433
35- # Step 3: Setup Java environment
3634 - name : Setup Java
3735 uses : actions/setup-java@v4
3836 with :
3937 distribution : ' temurin'
4038 java-version : ' 17'
4139
42- # Step 4: Setup Flutter environment
4340 - name : Setup Flutter
4441 uses : subosito/flutter-action@v2
4542 with :
4643 channel : stable
4744 cache : true
4845
49- # Step 5: Fix Infrastructure (Gradle 8.13)
50- - name : Force Update Gradle Wrapper to 8.13
46+ # This step is still needed to ensure the environment matches the latest AGP requirements
47+ - name : Update Gradle Wrapper
5148 run : |
5249 mkdir -p android/gradle/wrapper
5350 printf "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip" > android/gradle/wrapper/gradle-wrapper.properties
5451
55- # Step 6: Fix Kotlin Syntax for build.gradle.kts
56- - name : Fix Kotlin jvmTarget Syntax
52+ - name : Get Dependencies
5753 run : |
58- sed -i 's/jvmTarget = JavaVersion.VERSION_11.toString()//g' android/app/build.gradle.kts || true
59- sed -i 's/kotlinOptions.jvmTarget = "11"//g' android/app/build.gradle.kts || true
60-
61- # Step 7: Resolve Dependency Hell with Overrides
62- # This step fixes version conflicts by forcing compatible versions of shared dependencies
63- - name : Resolve Package Conflicts
64- run : |
65- # Ensure SDK constraints support modern packages (3.0.0+)
66- sed -i 's/sdk: ">=2.7.0 <3.0.0"/sdk: ">=3.0.0 <4.0.0"/g' pubspec.yaml || true
67-
68- # Inject dependency_overrides to force 'web' and 'connectivity' to compatible versions
69- # This prevents conflicts between battery_plus, connectivity_plus and easy_localization_loader
70- cat >> pubspec.yaml <<EOF
71-
72- dependency_overrides :
73- web : ^1.0.0
74- connectivity_plus : ^6.0.3
75- EOF
7654 flutter pub get
7755
78- # Step 8: Build APK
7956 - name : Build APK (Debug Mode)
8057 run : |
81- # Disable signing configuration for CI
58+ # Strip signing config for CI build
8259 sed -i 's/signingConfig = signingConfigs.getByName("release")//g' android/app/build.gradle* || true
8360
84- # Build the APK while ignoring common dart-defined errors if possible
8561 flutter build apk --debug --flavor normal
8662
8763 mkdir -p build/outputs/
8864 cp build/app/outputs/flutter-apk/app-normal-debug.apk build/outputs/updatium-nightly-debug.apk
8965
90- # Step 9: Artifacts and Release
9166 - name : Upload Artifact
9267 uses : actions/upload-artifact@v4
9368 with :
0 commit comments