From 1420d0a11399f2bc71dea9b814221630deee5cee Mon Sep 17 00:00:00 2001 From: nicolas Date: Mon, 14 Sep 2026 10:07:15 +0200 Subject: [PATCH] feat(ci): restore universal APK, set 7-day retention for artifacts, and clean workspace to save storage --- .gitea/workflows/build-apk.yaml | 36 +++++++++++++++++++++++++++----- .github/workflows/build-apk.yaml | 36 +++++++++++++++++++++++++++----- 2 files changed, 62 insertions(+), 10 deletions(-) diff --git a/.gitea/workflows/build-apk.yaml b/.gitea/workflows/build-apk.yaml index f6a4946..afcc2cc 100644 --- a/.gitea/workflows/build-apk.yaml +++ b/.gitea/workflows/build-apk.yaml @@ -102,7 +102,14 @@ jobs: flutter analyze flutter test - - name: Build Split-per-ABI Release APKs (3 APKs) + - name: Build Universal Release APK + run: | + flutter build apk --release || { + echo "Checking if APK was built despite path mismatch..." + find build android -type f -name "*release*.apk" 2>/dev/null + } + + - name: Build Split-per-ABI Release APKs run: | flutter build apk --release --split-per-abi || { echo "Checking if split APKs were built despite path mismatch..." @@ -112,6 +119,13 @@ jobs: - name: Organize Artifacts run: | mkdir -p release-apks + # Copy universal APK + if [ -f build/app/outputs/flutter-apk/app-release.apk ]; then + cp build/app/outputs/flutter-apk/app-release.apk release-apks/oggauer-gemeindetrommler-universal.apk + elif [ -f android/app/build/outputs/apk/release/app-release.apk ]; then + cp android/app/build/outputs/apk/release/app-release.apk release-apks/oggauer-gemeindetrommler-universal.apk + fi + # Copy split APKs for apk in build/app/outputs/flutter-apk/*.apk android/app/build/outputs/apk/release/*.apk; do [ -f "$apk" ] || continue case "$(basename "$apk")" in @@ -120,29 +134,36 @@ jobs: *x86_64*) cp "$apk" release-apks/oggauer-gemeindetrommler-x86_64.apk ;; esac done - echo "=== Generated 3 Split APK Artifacts ===" + echo "=== Generated All 4 APK Artifacts ===" ls -lah release-apks/ + - name: Upload Universal APK + uses: actions/upload-artifact@v3 + with: + name: oggauer-gemeindetrommler-universal + path: release-apks/oggauer-gemeindetrommler-universal.apk + retention-days: 7 + - name: Upload ARM64 APK uses: actions/upload-artifact@v3 with: name: oggauer-gemeindetrommler-arm64-v8a path: release-apks/oggauer-gemeindetrommler-arm64-v8a.apk - retention-days: 30 + retention-days: 7 - name: Upload ARMv7 APK uses: actions/upload-artifact@v3 with: name: oggauer-gemeindetrommler-armeabi-v7a path: release-apks/oggauer-gemeindetrommler-armeabi-v7a.apk - retention-days: 30 + retention-days: 7 - name: Upload x86_64 APK uses: actions/upload-artifact@v3 with: name: oggauer-gemeindetrommler-x86_64 path: release-apks/oggauer-gemeindetrommler-x86_64.apk - retention-days: 30 + retention-days: 7 - name: Publish Direct APKs to Gitea Releases continue-on-error: true @@ -153,3 +174,8 @@ jobs: RELEASE_TAG: latest run: | node scripts/ci/publish_release.js + + - name: Clean Workspace Disk Space + if: always() + run: | + rm -rf build android/.gradle release-apks 2>/dev/null || true diff --git a/.github/workflows/build-apk.yaml b/.github/workflows/build-apk.yaml index 2e69342..7a6500d 100644 --- a/.github/workflows/build-apk.yaml +++ b/.github/workflows/build-apk.yaml @@ -102,7 +102,14 @@ jobs: flutter analyze flutter test - - name: Build Split-per-ABI Release APKs (3 APKs) + - name: Build Universal Release APK + run: | + flutter build apk --release || { + echo "Checking if APK was built despite path mismatch..." + find build android -type f -name "*release*.apk" 2>/dev/null + } + + - name: Build Split-per-ABI Release APKs run: | flutter build apk --release --split-per-abi || { echo "Checking if split APKs were built despite path mismatch..." @@ -112,6 +119,13 @@ jobs: - name: Organize Artifacts run: | mkdir -p release-apks + # Copy universal APK + if [ -f build/app/outputs/flutter-apk/app-release.apk ]; then + cp build/app/outputs/flutter-apk/app-release.apk release-apks/oggauer-gemeindetrommler-universal.apk + elif [ -f android/app/build/outputs/apk/release/app-release.apk ]; then + cp android/app/build/outputs/apk/release/app-release.apk release-apks/oggauer-gemeindetrommler-universal.apk + fi + # Copy split APKs for apk in build/app/outputs/flutter-apk/*.apk android/app/build/outputs/apk/release/*.apk; do [ -f "$apk" ] || continue case "$(basename "$apk")" in @@ -120,26 +134,38 @@ jobs: *x86_64*) cp "$apk" release-apks/oggauer-gemeindetrommler-x86_64.apk ;; esac done - echo "=== Generated 3 Split APK Artifacts ===" + echo "=== Generated All 4 APK Artifacts ===" ls -lah release-apks/ + - name: Upload Universal APK + uses: actions/upload-artifact@v3 + with: + name: oggauer-gemeindetrommler-universal + path: release-apks/oggauer-gemeindetrommler-universal.apk + retention-days: 7 + - name: Upload ARM64 APK uses: actions/upload-artifact@v3 with: name: oggauer-gemeindetrommler-arm64-v8a path: release-apks/oggauer-gemeindetrommler-arm64-v8a.apk - retention-days: 30 + retention-days: 7 - name: Upload ARMv7 APK uses: actions/upload-artifact@v3 with: name: oggauer-gemeindetrommler-armeabi-v7a path: release-apks/oggauer-gemeindetrommler-armeabi-v7a.apk - retention-days: 30 + retention-days: 7 - name: Upload x86_64 APK uses: actions/upload-artifact@v3 with: name: oggauer-gemeindetrommler-x86_64 path: release-apks/oggauer-gemeindetrommler-x86_64.apk - retention-days: 30 + retention-days: 7 + + - name: Clean Workspace Disk Space + if: always() + run: | + rm -rf build android/.gradle release-apks 2>/dev/null || true