From 068c7282eaba2065c267bf42c57d7a117573cbce Mon Sep 17 00:00:00 2001 From: Dasemu Date: Thu, 22 Jan 2026 09:53:17 +0100 Subject: [PATCH] feat: update APK build process to rename output and publish latest release --- .gitea/workflows/build-apk.yml | 34 ++++++++++++++++++++------------- .github/workflows/build-apk.yml | 34 ++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/build-apk.yml b/.gitea/workflows/build-apk.yml index 7bc7914..67bf137 100644 --- a/.gitea/workflows/build-apk.yml +++ b/.gitea/workflows/build-apk.yml @@ -5,6 +5,9 @@ on: branches: [main] workflow_dispatch: +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -59,18 +62,23 @@ jobs: working-directory: android run: ./gradlew assembleDebug --no-daemon - - name: Upload Release APK - if: ${{ secrets.KEYSTORE_BASE64 != '' }} - uses: actions/upload-artifact@v4 - with: - name: impostor-game-release - path: android/app/build/outputs/apk/release/app-release.apk - retention-days: 30 + - name: Rename APK + run: | + if [ -f android/app/build/outputs/apk/release/app-release.apk ]; then + cp android/app/build/outputs/apk/release/app-release.apk impostor-game.apk + else + cp android/app/build/outputs/apk/debug/app-debug.apk impostor-game.apk + fi - - name: Upload Debug APK (fallback) - if: ${{ secrets.KEYSTORE_BASE64 == '' }} - uses: actions/upload-artifact@v4 + - name: Update latest release + uses: softprops/action-gh-release@v2 with: - name: impostor-game-debug - path: android/app/build/outputs/apk/debug/app-debug.apk - retention-days: 30 + tag_name: latest + name: Latest Build + body: | + Última versión del APK generada automáticamente. + + Commit: ${{ github.sha }} + files: impostor-game.apk + prerelease: false + make_latest: true diff --git a/.github/workflows/build-apk.yml b/.github/workflows/build-apk.yml index 64316bf..3fda03c 100644 --- a/.github/workflows/build-apk.yml +++ b/.github/workflows/build-apk.yml @@ -5,6 +5,9 @@ on: branches: [main] workflow_dispatch: +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -70,18 +73,23 @@ jobs: working-directory: android run: ./gradlew assembleDebug --no-daemon - - name: Upload Release APK - if: steps.keystore-check.outputs.exists == 'true' - uses: actions/upload-artifact@v4 - with: - name: impostor-game-release - path: android/app/build/outputs/apk/release/app-release.apk - retention-days: 30 + - name: Rename APK + run: | + if [ "${{ steps.keystore-check.outputs.exists }}" == "true" ]; then + cp android/app/build/outputs/apk/release/app-release.apk impostor-game.apk + else + cp android/app/build/outputs/apk/debug/app-debug.apk impostor-game.apk + fi - - name: Upload Debug APK (fallback) - if: steps.keystore-check.outputs.exists == 'false' - uses: actions/upload-artifact@v4 + - name: Update latest release + uses: softprops/action-gh-release@v2 with: - name: impostor-game-debug - path: android/app/build/outputs/apk/debug/app-debug.apk - retention-days: 30 \ No newline at end of file + tag_name: latest + name: Latest Build + body: | + Última versión del APK generada automáticamente. + + Commit: ${{ github.sha }} + files: impostor-game.apk + prerelease: false + make_latest: true \ No newline at end of file