-
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.03 KB
/
build-app.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
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Build Application
on:
workflow_dispatch:
pull_request:
branches: [ main ]
paths:
- '**/*.gradle.kts'
- 'app/src/**'
- '.github/workflows/build-app.yml'
push:
branches: [ main ]
paths:
- '**/*.gradle.kts'
- 'app/src/**'
- '.github/workflows/build-app.yml'
jobs:
build-app:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17 and Gradle cache
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'
- name: Make Gradle executable
run: chmod +x gradlew
# Build App
- name: Build Application with Gradle
env:
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
run: ./gradlew build
# Build Debug APK
- name: Build debug apk
env:
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
run: ./gradlew assembleDebug
# Build Release APK
- name: Build release apk
env:
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
run: ./gradlew assemble
# Build Bundle AAB Release
- name: Build release aab
env:
NEWS_API_KEY: ${{ secrets.NEWS_API_KEY }}
run: ./gradlew app:bundleRelease
- name: Upload the app-debug.apk artifact
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- name: Upload the app-release.apk artifact
uses: actions/upload-artifact@v4
with:
name: app-release
path: app/build/outputs/apk/release/app-release-unsigned.apk
- name: Upload the app-release.aab artifact
uses: actions/upload-artifact@v4
with:
name: aab-release
path: app/build/outputs/bundle/release/app-release.aab
- name: Upload the Room Database Schema
uses: actions/upload-artifact@v4
with:
name: room-database-schema
path: app/schemas/**/*.json