-
Notifications
You must be signed in to change notification settings - Fork 1
67 lines (55 loc) · 1.77 KB
/
android.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
57
58
59
60
61
62
63
64
65
66
67
name: Android CI
on:
pull_request:
push:
branches:
- 'main'
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/[email protected]
- name: Setup Java 17
uses: actions/[email protected]
with:
distribution: 'adopt'
java-version: '17'
check-latest: false
# Enable caching for Gradle dependencies
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
gradle-${{ runner.os }}-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@f9c9c575b8b21b6485636a91ffecd10e558c62f6
# Build the project
- name: Build with Gradle
run: ./gradlew build
# Run Android Lint to check for code issues
- name: Run Android Lint
run: ./gradlew lint
# Build the debug bundle
- name: Bundle (Debug)
run: ./gradlew bundleDebug
# Upload the debug bundle
- name: Upload APK (Debug)
uses: actions/[email protected]
with:
name: Debug-APK
path: app/build/outputs/apk/debug/app-debug.apk
# Build the release bundle
- name: Build Bundle (Release)
if: github.ref == 'refs/heads/main'
run: ./gradlew bundleRelease
# Upload the release bundle
- name: Upload Bundle (Release)
if: github.ref == 'refs/heads/main'
uses: actions/[email protected]
with:
name: Release-Bundle
path: app/build/outputs/bundle/release/app-release.aab