Skip to content

Commit d526c21

Browse files
committed
fix(ci): set gradle executable permissions and correct APK path
1 parent 0894fc5 commit d526c21

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/android-build.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,22 @@ jobs:
2929
- name: Setup Android SDK
3030
uses: android-actions/setup-android@v3
3131

32-
# 4. 赋予 Gradle 可执行权限
33-
- name: Grant execute permission for gradlew
34-
run: chmod +x ./gradlew
35-
32+
# 4. 进入 android 目录并设置 Gradle 可执行权限
33+
- name: Set up Android build environment
34+
run: |
35+
cd android
36+
chmod +x ./gradlew
37+
3638
# 5. 构建 Debug APK 并重命名为时间戳
3739
- name: Build Debug APK with Timestamp
3840
run: |
41+
cd android
3942
./gradlew assembleDebug
4043
# Set timezone to Beijing (UTC+8) for the timestamp
4144
export TZ='Asia/Shanghai'
4245
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
4346
cp app/build/outputs/apk/debug/app-debug.apk app/build/outputs/apk/debug/app-debug-${TIMESTAMP}.apk
44-
echo "APK_PATH=app/build/outputs/apk/debug/app-debug-${TIMESTAMP}.apk" >> $GITHUB_ENV
47+
echo "APK_PATH=android/app/build/outputs/apk/debug/app-debug-${TIMESTAMP}.apk" >> $GITHUB_ENV
4548
4649
# 6. 提取版本号
4750
- name: Extract versionName

0 commit comments

Comments
 (0)