Skip to content

https://github.com/android/sunflower:assembleDebug #1

https://github.com/android/sunflower:assembleDebug

https://github.com/android/sunflower:assembleDebug #1

# From https://github.com/ni554n/apk-builder-action
# guide https://github.com/marketplace/actions/automated-build-android-app-with-github-action
name: Build Android APK
run-name: ${{ github.event.inputs.repository }}:${{ github.event.inputs.taskName }}
on:
workflow_dispatch:
inputs:
repository:
description: "Git repository URL"
required: true
default: "https://github.com/android/sunflower"
jdkVersion:
description: "OpenJDK version to use: 8 / 11 / 17 etc."
required: false
default: "8"
taskName:
description: "build.gradle task name: assemble[Flavor]Debug"
required: false
default: "assembleDebug"
jobs:
build:
runs-on: ubuntu-latest # Android SDK is built-in in this image
steps:
# Set Current Date As Env Variable
- name: Set Current DATE
run: echo "date_today=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: ${{ github.event.inputs.jdkVersion }}
- name: Clone project
run: git clone --depth=1 ${{ github.event.inputs.repository }} workspace
- name: Build APK
working-directory: ./workspace
run: |
if [ ! -f "gradlew" ]; then gradle wrapper; fi
chmod +x gradlew
./gradlew ${{ github.event.inputs.taskName }} --stacktrace
- name: Upload the APK artifact with 1 day retention
uses: actions/upload-artifact@v3
with:
path: workspace/app/build/outputs/apk/debug/
name: apk-debug [${{ env.date_today }}].apk
retention-days: 1