Skip to content

Commit 01b7bf0

Browse files
committed
Update CI workflow to set Gradle version based on AGP selection: add a conditional step in the GitHub Actions workflow to adjust the Gradle distribution URL according to the specified AGP version, ensuring compatibility with Gradle 9.1.0 for AGP 9.0.0 and 8.11.1 for earlier versions.
1 parent 8feae7f commit 01b7bf0

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,13 @@ jobs:
7272
- name: Set AGP version in version catalog
7373
run: sed -i.bak 's/^agp = ".*"/agp = "${{ matrix.agp-version }}"/' gradle/libs.versions.toml
7474

75+
- name: Set Gradle version for selected AGP
76+
run: |
77+
if [ "${{ matrix.agp-version }}" = "9.0.0" ]; then
78+
sed -i.bak 's#^distributionUrl=.*#distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip#' gradle/wrapper/gradle-wrapper.properties
79+
else
80+
sed -i.bak 's#^distributionUrl=.*#distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-all.zip#' gradle/wrapper/gradle-wrapper.properties
81+
fi
82+
7583
- name: AGP compatibility check (assembleDebug)
7684
run: ./gradlew :app:assembleDebug --no-daemon

0 commit comments

Comments
 (0)