-
Notifications
You must be signed in to change notification settings - Fork 929
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
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 |