fix: 尝试修复 NDK 缓存功能(AI)

This commit is contained in:
Super12138 2026-02-14 23:27:01 +08:00 committed by GitHub
parent 8b1ec55ff9
commit 71abf6435f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,4 +1,8 @@
name: Android CI
env:
NDK_VERSION: "28.2.13676358"
on:
push:
branches: [ "main" ]
@ -24,20 +28,16 @@ jobs:
distribution: 'temurin'
cache: gradle
# 缓存NDK
- name: Cache NDK
id: cache-ndk
uses: actions/cache@v5.0.3
with:
path: |
${{ env.ANDROID_HOME }}/ndk
key: ndk-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
ndk-${{ runner.os }}-
path: ${{ env.ANDROID_HOME }}/ndk/${{ env.NDK_VERSION }}
key: ${{ runner.os }}-ndk-${{ env.NDK_VERSION }}
# 仅当NDK缓存未命中时才安装NDK
- name: Install NDK 28.2.13676358
- name: Install NDK
if: steps.cache-ndk.outputs.cache-hit != 'true'
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install 'ndk;28.2.13676358'
run: echo "y" | sudo ${ANDROID_HOME}/cmdline-tools/latest/bin/sdkmanager --install "ndk;${{ env.NDK_VERSION }}"
- name: Grant execute permission for gradlew
run: chmod +x gradlew
@ -56,7 +56,7 @@ jobs:
- name: Fix Permissions for Debug Keystore Path
if: github.ref != 'refs/heads/main'
run: sudo chmod -R 777 /home/runner/.config/.android
- name: Build with Gradle
run: ./gradlew assembleRelease