File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,13 @@ jobs:
17
17
18
18
- name : Build release
19
19
run : ./gradlew assembleRelease
20
+ env :
21
+ KEYSTORE_PASSWORD : ${{ secrets.KEYSTORE_PASSWORD }}
20
22
21
23
- uses : actions/upload-artifact@v2
22
24
with :
23
25
name : app
24
- path : app/build/outputs/apk/release/app-release-unsigned .apk
26
+ path : app/build/outputs/apk/release/app-* .apk
25
27
if-no-files-found : error
26
28
27
29
deploy :
41
43
with :
42
44
prerelease : true
43
45
asset_name : pinning-demo.apk
44
- file : ${{ steps.get_apk.outputs.download-path }}/app-release-unsigned .apk
46
+ file : ${{ steps.get_apk.outputs.download-path }}/app-release.apk
45
47
tag : ${{ github.ref }}
46
48
repo_token : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ plugins {
3
3
id ' kotlin-android'
4
4
}
5
5
6
+ def keyStorePassword = System . getenv(' KEYSTORE_PASSWORD' )
7
+ def keyAvailable = !! keyStorePassword
8
+
6
9
android {
7
10
compileSdkVersion 30
8
11
buildToolsVersion " 30.0.2"
@@ -17,9 +20,23 @@ android {
17
20
testInstrumentationRunner " androidx.test.runner.AndroidJUnitRunner"
18
21
}
19
22
23
+ signingConfigs {
24
+ release {
25
+ storeFile file(" ./keystore.jks" )
26
+ storePassword keyStorePassword
27
+ keyAlias " signing_key"
28
+ keyPassword keyStorePassword
29
+ }
30
+ }
31
+
20
32
buildTypes {
21
33
release {
22
34
minifyEnabled false
35
+ if (keyAvailable) {
36
+ signingConfig signingConfigs. release
37
+ } else {
38
+ logger. warn(' No signing key available' )
39
+ }
23
40
proguardFiles getDefaultProguardFile(' proguard-android-optimize.txt' ), ' proguard-rules.pro'
24
41
}
25
42
}
You can’t perform that action at this time.
0 commit comments