-
Notifications
You must be signed in to change notification settings - Fork 0
140 lines (110 loc) · 3.8 KB
/
deploy.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Publish
on:
push:
branches: [ master ]
jobs:
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Grand execute permissions to gradlew
run: chmod +x gradlew
- name: Run unit tests
run: ./gradlew testDebug
apk:
name: Generate APK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Grand execute permissions to gradlew
run: chmod +x gradlew
- name: Assemble app debug APK
run: ./gradlew assembleDebug
- name: Upload app APK
uses: actions/upload-artifact@v4
with:
name: app-debug
path: app/build/outputs/apk/debug/app-debug.apk
- name: Assemble app instrumental tests
run: ./gradlew assembleDebugAndroidTest
- name: Upload app test APK
uses: actions/upload-artifact@v4
with:
name: app-debug-androidTest
path: app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk
firebase:
name: Run UI tests with firebase Test Lab
needs: [ apk ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download app APK
uses: actions/download-artifact@v4
with:
name: app-debug
- name: Download app test APK
uses: actions/download-artifact@v4
with:
name: app-debug-androidTest
- name: 'Google Cloud Auth'
uses: google-github-actions/auth@v2
with:
credentials_json: '${{ secrets.GOOGLE_SERVICES_JSON }}'
- name: Set up Google Cloud SDK
uses: google-github-actions/setup-gcloud@v2
with:
project_id: ${{ secrets.SOME_PROJECT_ID }}
service_account_key: ${{ secrets.GOOGLE_SERVICES_JSON }}
export_default_credentials: true
- name: Run instrumental tests in Firebase Test Lab
run: gcloud firebase test android run --type instrumentation --app app-debug/app-debug.apk --test app-debug-androidTest/app-debug-androidTest.apk --device model=blueline,version=28
distribute:
name: Distribute app bundle to Play Store
needs: [ firebase ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
- name: Bump version
uses: chkfung/android-version-actions@v1.2.3
with:
gradlePath: app/build.gradle.kts
versionCode: ${{ github.run_number }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Assemble Release Bundle
run: ./gradlew bundleRelease
- name: Sign Release
uses: r0adkll/sign-android-release@v1.0.4
with:
releaseDirectory: app/build/outputs/bundle/release
signingKeyBase64: ${{ secrets.ANDROID_KEYSTORE }}
alias: ${{ secrets.SOME_KEY_ALIAS }}
keyStorePassword: ${{ secrets.KEYSTORE_PASSWORD }}
keyPassword: ${{ secrets.SOME_KEY_PASSWORD }}
# - name: Setup authorization with Google Play Store
# run: echo '${{ secrets.GOOGLE_SERVICES_API }}' > service_account.json
#
# - name: Deploy to Internal
# uses: r0adkll/upload-google-play@v1
# with:
# serviceAccountJson: service_account.json
# packageName: dev.m13d.somenet
# releaseFiles: app/build/outputs/bundle/release/app-release.aab
# track: internal
# whatsNewDirectory: whatsNewDirectory/