diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml index 63dfa1145..a8715c534 100644 --- a/.github/workflows/pr_build.yml +++ b/.github/workflows/pr_build.yml @@ -1,15 +1,13 @@ -# A workflow to build and upload APKs for pull requests -name: PR Build +# A workflow to build and upload APKs +name: APK Build on: - pull_request: - types: [ opened, synchronize, reopened ] - branches: [ master ] + workflow_dispatch: + # This event allows manual triggering of the workflow + # You can manually trigger this workflow through the GitHub Actions UI or API +env: + UPLOAD_PR_ARTIFACTS: 'true' # Define the variable here -# Only allow the latest build to run for a given PR, and cancel any previous builds -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true jobs: build: @@ -55,20 +53,20 @@ jobs: run: ./gradlew --no-daemon --stacktrace --build-cache --parallel --configure-on-demand assembleDevRelease assembleDevReldebug - name: Rename APKs - if: ${{ vars.UPLOAD_PR_ARTIFACTS == 'true' }} + if: ${{ env.UPLOAD_PR_ARTIFACTS == 'true' }} run: | mv app/build/outputs/apk/dev/release/app-dev-release.apk strato-pr${{ github.event.number }}-release.apk mv app/build/outputs/apk/dev/reldebug/app-dev-reldebug.apk strato-pr${{ github.event.number }}-reldebug.apk - name: Upload Release APK - if: ${{ vars.UPLOAD_PR_ARTIFACTS == 'true' }} + if: ${{ env.UPLOAD_PR_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: strato-pr${{ github.event.number }}-release.apk path: strato-pr${{ github.event.number }}-release.apk - name: Upload Debug APK - if: ${{ vars.UPLOAD_PR_ARTIFACTS == 'true' }} + if: ${{ env.UPLOAD_PR_ARTIFACTS == 'true' }} uses: actions/upload-artifact@v4 with: name: strato-pr${{ github.event.number }}-reldebug.apk