Build - Ad-hoc release #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build - Ad-hoc release | |
on: | |
workflow_dispatch: | |
inputs: | |
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 }} | |
GOOGLE_APPLICATION_CREDENTIALS: '#{ENV["HOME"]}/jenkins_static/com.duckduckgo.mobile.android/ddg-upload-firebase.json' | |
GH_TOKEN: ${{ secrets.GT_DAXMOBILE }} | |
jobs: | |
build-apk: | |
name: Generate and upload universal APK to GH Action Run | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
token: ${{ secrets.GT_DAXMOBILE }} | |
ref: ${{ github.event.inputs.app-version }} | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v4 | |
with: | |
java-version: '17' | |
distribution: 'adopt' | |
- name: Create folder | |
if: always() | |
run: mkdir apk | |
- name: Decode keys | |
uses: davidSchuppa/base64Secret-toFile-action@v2 | |
with: | |
secret: ${{ secrets.FAKE_RELEASE_PROPERTIES }} | |
fileName: ddg_android_build.properties | |
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | |
- name: Decode key file | |
uses: davidSchuppa/base64Secret-toFile-action@v2 | |
with: | |
secret: ${{ secrets.FAKE_RELEASE_KEY }} | |
fileName: android | |
destination-path: $HOME/jenkins_static/com.duckduckgo.mobile.android/ | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
- 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 \; | |
- name: Upload debug apk | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: release | |
path: apk/release.apk |