From f06c8ec1a3ae3a8bcf399ee92e680fd6c4f5b452 Mon Sep 17 00:00:00 2001 From: "Phat H. Nguyen" Date: Tue, 11 Aug 2026 13:22:58 +0200 Subject: [PATCH] ci: upload PR APK artifacts directly --- .github/workflows/build.yml | 13 ++++++++----- gh-pages/docs/developer/1-how-to-build.md | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5fe92327..65229313 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -189,7 +189,7 @@ jobs: mv target/x/release/android/gradle/app/build/outputs/apk/debug/app-debug.apk target/x/localdesktop-${{ steps.extract_version.outputs.version }}-debug.apk mv target/x/release/android/gradle/app/build/outputs/apk/release/app-release.apk target/x/localdesktop-${{ steps.extract_version.outputs.version }}.apk - - name: Compute PR APK artifact name + - name: Prepare PR APK artifact id: pr_apk_artifact if: github.event_name == 'pull_request' env: @@ -203,15 +203,18 @@ jobs: SAFE_REF="pr-${PR_NUMBER}" fi SHORT_SHA="${HEAD_SHA:0:7}" - echo "name=localdesktop-${VERSION}-${SAFE_REF}-${SHORT_SHA}-release-apk" >> "$GITHUB_OUTPUT" + ARTIFACT_FILE="localdesktop-${VERSION}-${SAFE_REF}-${SHORT_SHA}-release.apk" + ARTIFACT_PATH="target/x/${ARTIFACT_FILE}" + cp "target/x/localdesktop-${VERSION}.apk" "$ARTIFACT_PATH" + echo "path=${ARTIFACT_PATH}" >> "$GITHUB_OUTPUT" - name: Upload PR release APK if: github.event_name == 'pull_request' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: - name: ${{ steps.pr_apk_artifact.outputs.name }} - path: target/x/localdesktop-${{ steps.extract_version.outputs.version }}.apk + path: ${{ steps.pr_apk_artifact.outputs.path }} if-no-files-found: error + archive: false - name: Build AAB if: github.event_name != 'pull_request' diff --git a/gh-pages/docs/developer/1-how-to-build.md b/gh-pages/docs/developer/1-how-to-build.md index 46d2a54e..56a573fc 100644 --- a/gh-pages/docs/developer/1-how-to-build.md +++ b/gh-pages/docs/developer/1-how-to-build.md @@ -35,7 +35,7 @@ Then you will find the APK file in `target/x/release/android/localdesktop.apk`. ### Can I test a release-signed APK from a PR? -Yes. Same-repository PRs targeting `main` produce a signed release APK artifact when they have exactly one app-release label: `release:breaking`, `release:feature`, `release:bugfix`, `release:patch`, `release:improvement`, or `release:optimisation`. Download the workflow artifact from GitHub Actions and install it over the GitHub APK. +Yes. Same-repository PRs targeting `main` produce a signed release APK artifact when they have exactly one app-release label: `release:breaking`, `release:feature`, `release:bugfix`, `release:patch`, `release:improvement`, or `release:optimisation`. Download the `.apk` workflow artifact from GitHub Actions and install it over the GitHub APK. Older artifacts may still download as `.zip` files. PRs labeled `release:docs` do not build an APK.