Fix: Correct Gradle installation logic for Alpine Linux
Android Build / build (push) Failing after 10s

This commit is contained in:
amos
2026-06-02 10:07:18 +08:00
parent d8ff4887b3
commit 85e111c00a
+6 -3
View File
@@ -24,13 +24,16 @@ jobs:
- name: Install Gradle - name: Install Gradle
run: | run: |
# 在容器内安装 Gradle # Alpine Linux 使用 apkDebian/Ubuntu 使用 apt-get
apk add --no-cache gradle || apt-get update && apt-get install -y gradle if command -v apk &> /dev/null; then
apk add --no-cache gradle
else
apt-get update && apt-get install -y gradle
fi
gradle --version gradle --version
- name: Build with Gradle - name: Build with Gradle
run: | run: |
# 生成 wrapper 并构建
gradle wrapper --gradle-version 8.2 gradle wrapper --gradle-version 8.2
./gradlew assembleDebug --no-daemon --stacktrace ./gradlew assembleDebug --no-daemon --stacktrace