Skip to content

Build test APKs and store artifacts #5

Build test APKs and store artifacts

Build test APKs and store artifacts #5

name: Build test APKs and store artifacts
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
#permissions:
# contents: write
jobs:
build-test-apks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Setup build tool version variable
shell: bash
run: |
BUILD_TOOL_VERSION=$(ls /usr/local/lib/android/sdk/build-tools/ | tail -n 1)
echo "BUILD_TOOL_VERSION=$BUILD_TOOL_VERSION" >> $GITHUB_ENV
echo Last build tool version is: $BUILD_TOOL_VERSION
- name: Setup Git commit SHA variable
run: echo "COMMIT_SHA=${GITHUB_SHA}" >> $GITHUB_ENV
# F-Droid APK
- name: Assemble unsigned F-Droid release APK
run: ./gradlew assembleFdroidRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store unsigned F-Droid release APK
uses: actions/upload-artifact@v4
with:
name: ${{ env.COMMIT_SHA }}-fdroid-unsigned-release.apk
path: app/build/outputs/apk/fdroid/release/*.apk
# "Premium" APK
- name: Add Dropbox app identifier
shell: bash
run: |
echo "dropbox.app_key = \"${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties
echo "dropbox.app_key_schema = \"db-${{ secrets.DROPBOX_APP_KEY }}\"" >> app.properties
- name: Assemble "premium" APK
run: ./gradlew assemblePremiumRelease --stacktrace
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Store unsigned Premium release APK
uses: actions/upload-artifact@v4
with:
name: ${{ env.COMMIT_SHA }}-premium-unsigned-release.apk
path: app/build/outputs/apk/premium/release/*.apk