-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (63 loc) · 1.58 KB
/
build.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
name: Minimal Android CI Workflow
permissions:
contents: 'write'
id-token: 'write'
on:
push:
jobs:
test:
name: Run Unit Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Run Tests
run: ./gradlew test --stacktrace
apk:
name: Generate APK
needs: test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '11'
- name: Generate APKs
run: ./gradlew clean assembleDebug assembleRelease
- name: Upload APKs
uses: actions/upload-artifact@v4
with:
name: apk
path: app/build/outputs/apk/**/*.apk
release:
name: Release APK
needs: apk
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download APK from build
uses: actions/download-artifact@v4
with:
name: apk
- name: Upload APKs
if: startsWith(github.ref, 'refs/tags/')
id: upload_release_asset
uses: softprops/action-gh-release@v2
with:
files: |
debug/app-debug.apk
release/app-release-unsigned.apk