Skip to content

Commit

Permalink
GHA: Allow ad-hoc workflow to build different variants (#5470)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/488551667048375/1209097575356124/f

### Description
Allows to use a specific build variant
  • Loading branch information
malmstein authored Jan 15, 2025
1 parent 30fb95e commit f1ba7d5
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions .github/workflows/build-ad-hoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ on:
ref:
description: 'Ref to build APK from (branch, tag, commit)'
required: true
default: 'develop'
build-variant:
description: 'Android build variant'
required: true
default: 'playRelease'
type: choice
options:
- fdroidRelease
- internalDebug
- internalRelease
- playDebug
- playRelease

env:
ASANA_PAT: ${{ secrets.GH_ASANA_SECRET }}
Expand All @@ -23,8 +35,7 @@ jobs:
with:
submodules: recursive
token: ${{ secrets.GT_DAXMOBILE }}
ref: ${{ github.event.inputs.ref }}

ref: ${{ github.event.inputs.app-version }}
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
Expand Down Expand Up @@ -52,15 +63,15 @@ jobs:
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Assemble release APK
run: ./gradlew assemblePlayRelease -Pforce-default-variant
- name: Assemble APK
run: ./gradlew assemble${{github.event.inputs.build-variant}} -Pforce-default-variant

- name: Move APK to new folder
run: find . -name "*.apk" -exec mv '{}' apk/release.apk \;
run: find . -name "*.apk" -exec mv '{}' apk/release${{github.event.inputs.build-variant}}.apk \;

- name: Upload debug apk
if: always()
uses: actions/upload-artifact@v4
with:
name: release
path: apk/release.apk
path: apk/release${{github.event.inputs.build-variant}}.apk

0 comments on commit f1ba7d5

Please sign in to comment.