https://github.com/android/sunflower:assembleDebug #23
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 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: "17" | |
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: | |
- name: Setup JDK | |
uses: actions/setup-java@v4 | |
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@v4 | |
with: | |
path: ./**/*.apk | |
name: apk-archive | |
retention-days: 1 |