[Fix] (CI): scan rather than hardcode apk file name

This commit is contained in:
2026-05-24 18:45:24 +08:00
parent 27a8aa057c
commit c7d385c03d
+17 -2
View File
@@ -56,10 +56,25 @@ jobs:
- name: Verify signed APK
run: |
APKSIGNER="$(find "$ANDROID_HOME/build-tools" -name apksigner -type f | sort -V | tail -n 1)"
"$APKSIGNER" verify --verbose android-plugin/app/build/outputs/apk/release/app-release.apk
mapfile -t APKS < <(find android-plugin/app/build/outputs/apk -type f -path '*/release/*.apk' | sort)
if [ "${#APKS[@]}" -eq 0 ]; then
echo "::error::No release APKs found under android-plugin/app/build/outputs/apk"
find android-plugin/app/build/outputs/apk -type f -print || true
exit 1
fi
for APK in "${APKS[@]}"; do
if [[ "$APK" == *-unsigned.apk ]]; then
echo "::error::Unsigned release APK produced: $APK"
exit 1
fi
"$APKSIGNER" verify --verbose "$APK"
done
- name: Upload plugin APK
uses: actions/upload-artifact@v4
with:
name: MobileGL-plugin-${{ env.date_today }}-${{ env.short_sha }}
path: android-plugin/app/build/outputs/apk/release/app-release.apk
path: |
android-plugin/app/build/outputs/apk/release/*.apk
android-plugin/app/build/outputs/apk/**/release/*.apk