forked from ni554n/apk-builder-action
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (40 loc) · 1.33 KB
/
build-apk.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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/BlackyHawky/New-Clock"
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@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: ./**/*.apk
name: apk-archive
retention-days: 1