https://github.com/codepath/android_hello_world:assembleDebug #17
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
# From https://github.com/ni554n/apk-builder-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: | |
- 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 |