Repository navigation
63 lines (50 loc) · 1.65 KB
/
Copy pathandroid.yml
File metadata and controls
63 lines (50 loc) · 1.65 KB
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
name: Android CI
on:
push:
branches: [ "dev", "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: check out repository
uses: actions/checkout@v3
- name: set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: gradle
- name: Cache Gradle Packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{runner.os}}-gradle-${{hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**.*.kt')}}
restore-keys: ${{runner.os}}-gradle-
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Access Google-Service file
run: echo '${{ secrets.GOOGLE_SERVICE }}' > ./app/google-services.json
# - name: Run klint
# run: ./gradlew klintCheck
- name: Run unit tests
run: ./gradlew testDebugUnitTest
- name: Build with Gradle
run: ./gradlew assembleRelease
if: "contains(github.ref, 'main')"
- name: Build with Gradle
run: ./gradlew assembleDebug
if: "contains(github.ref, 'dev')"
deploy:
runs-on: ubuntu-latest
needs: build
if: "contains(github.ref, 'main')"
steps:
- name: upload artifact to Firebase App Distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1
with:
appId: ${{secrets.FIREBASE_APP_ID}}
serviceCredentialsFileContent: ${{secrets.CREDENTIAL_FILE_CONTENT}}
groups: base
file: app/build/outputs/apk/release/app-release-unsigned.apk