Skip to content

Commit

Permalink
GHA: Ad-hoc build (#5456)
Browse files Browse the repository at this point in the history
Task/Issue URL:
https://app.asana.com/0/1174433894299346/1209097575356124/f

### Description
Adds a workflow that generates a release build from a ref passed as
input parameter

### Steps to test this PR
See builds in Asana task
  • Loading branch information
malmstein authored Jan 10, 2025
1 parent 5e2879c commit e632d53
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/build-ad-hoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build - Ad-hoc release

on:
workflow_dispatch:
inputs:
ref:
description: 'Ref to build APK from (branch, tag, commit)'
required: true
default: 'develop'

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 release APK
run: ./gradlew assemblePlayRelease -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

0 comments on commit e632d53

Please sign in to comment.