-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (74 loc) · 2.41 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Android CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
jobs:
unit_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Unit Tests
run: ./gradlew test
build:
needs: [unit_tests]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Android SDK Tools
uses: android-actions/setup-android@v3.2.0
with:
package: 'build-tools;29.0.3'
- name: Clean the build
run: ./gradlew clean
- name: Generate Release APK
run: ./gradlew assembleRelease
- name: Sign Android release
uses: r0adkll/sign-android-release@v1.0.4
# ID used to access action output
id: sign_app
with:
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.ALIAS_KEY_PASSWORD }}
env:
# override default build-tools version (33.0.0) -- optional
BUILD_TOOLS_VERSION: "34.0.0"
- uses: actions/upload-artifact@main
with:
name: release.apk
path: ${{steps.sign_app.outputs.signedReleaseFile}}
- uses: actions/upload-artifact@main
with:
name: mapping.txt
path: app/build/outputs/mapping/release/mapping.txt
deploy-firebase:
runs-on: ubuntu-latest
steps:
- name: Download artifact
uses: actions/download-artifact@main
with:
name: release.apk
- name: upload artifact to Firebase App distribution
uses: wzieba/Firebase-Distribution-Github-Action@v1.7.0
with:
appId: ${{ secrets.FIREBASE_APP_ID }}
serviceCredentialsFileContent: ${{ secrets.CREDENTIAL_FILE_CONTENT }}
groups: internal-testers
file: /home/runner/work/android-cicd-githubActions/android-cicd-githubActions/app-release-signed.apk