-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (54 loc) · 1.62 KB
/
build-apk.yml
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
46
47
48
49
50
51
52
53
54
55
56
name: Build APK
on:
workflow_call:
inputs:
branch:
required: false
type: string
build_flavor:
required: false
type: string
default: live
jobs:
build:
runs-on: ubuntu-latest
steps:
- id: string
uses: ASzc/change-string-case-action@v5
with:
string: ${{inputs.build_flavor}}
- name: Set Build Variables
id: variables
run: |
echo "TASK=assemble${{steps.string.outputs.capitalized}}LocalDebug" >> $GITHUB_OUTPUT
echo "FILE_PATH=./app/build/outputs/apk/${{steps.string.outputs.lowercase}}Local/debug/app-${{steps.string.outputs.lowercase}}-local-debug.apk" >> $GITHUB_OUTPUT
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{inputs.branch}}
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Store Gradle cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: $-gradle-$
restore-keys: $-gradle-
- name: Setup Android SDK
uses: android-actions/setup-android@v2
- name: Grant execute permission for gradlew
shell: bash
run: chmod +x gradlew
- name: Build APK
uses: gradle/gradle-build-action@v2
with:
arguments: clean ${{steps.variables.outputs.TASK}}
- name: Upload APK
uses: actions/upload-artifact@v3
with:
name: payment-sdk-android
path: ${{steps.variables.outputs.FILE_PATH}}