From 861df6daa1644ea108abe0299e9b676ef81a13d6 Mon Sep 17 00:00:00 2001 From: Tej Pratap Singh Date: Fri, 12 Dec 2025 19:24:56 +0530 Subject: [PATCH 1/2] Add workflow to build and upload debug APKs This workflow builds all debug APKs and uploads them as release assets when a release is published. --- .github/workflows/android-release.yml | 58 +++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/android-release.yml diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml new file mode 100644 index 00000000..af3c9487 --- /dev/null +++ b/.github/workflows/android-release.yml @@ -0,0 +1,58 @@ +name: Build and Attach ALL Debug APKs to Release + +on: + release: + types: [published] + +jobs: + build_and_attach: + runs-on: ubuntu-latest + if: github.event.release.prerelease == false && github.event.release.draft == false + + steps: + - name: ⚙️ Checkout Repository + uses: actions/checkout@v4 + + - name: ☕ Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: 'gradle' + + - name: 📁 Set up Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: 🔨 Build ALL Debug APKs + run: | + # This command builds the debug variant for ALL application modules found in the project. + # The resulting APKs will be scattered in their respective module build directories. + ./gradlew assembleDebug + + # Define the path to ALL generated APK files + # This step finds all files ending in -debug.apk within the build/outputs/apk/debug folders across the repo. + - name: 📌 Define ALL APK Paths + id: apk_paths + run: | + # Finds all debug APKs in a standard Android project structure and saves them as a multi-line string. + # We use a glob search pattern here to find all of them. + FIND_COMMAND=$(find . -path '*/build/outputs/apk/debug/*-debug.apk' -type f) + + # We escape the newline characters for proper output handling in GitHub Actions + ESCAPED_PATHS="${FIND_COMMAND//$'\n'/%0A}" + + echo "APK_FILES=$ESCAPED_PATHS" >> $GITHUB_OUTPUT + + - name: 📝 Show built APK paths + run: | + echo "Found the following APKs to upload:" + echo "${{ steps.apk_paths.outputs.APK_FILES }}" + + # Upload ALL the built APKs as release assets + - name: 📤 Upload ALL APKs to Release Assets + uses: softprops/action-gh-release@v1 + if: steps.apk_paths.outputs.APK_FILES != '' + with: + # This variable now contains all paths, separated by newlines + files: ${{ steps.apk_paths.outputs.APK_FILES }} + token: ${{ secrets.GITHUB_TOKEN }} From e595edc36b5e90af4584914de21dae2a0f47ce88 Mon Sep 17 00:00:00 2001 From: Tej Pratap Singh Date: Fri, 12 Dec 2025 19:37:38 +0530 Subject: [PATCH 2/2] Upgrade action-gh-release to version 2 --- .github/workflows/android-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/android-release.yml b/.github/workflows/android-release.yml index af3c9487..20535773 100644 --- a/.github/workflows/android-release.yml +++ b/.github/workflows/android-release.yml @@ -50,7 +50,7 @@ jobs: # Upload ALL the built APKs as release assets - name: 📤 Upload ALL APKs to Release Assets - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 if: steps.apk_paths.outputs.APK_FILES != '' with: # This variable now contains all paths, separated by newlines