Skip to content

Commit a5e8871

Browse files
committed
更新CI可手动触发并自动签名APK
1 parent fa2bcad commit a5e8871

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

.github/workflows/android.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@ name: Android CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches:
6+
- master
67
pull_request:
7-
branches: [ master ]
8+
branches:
9+
- master
10+
paths:
11+
- '.github/workflows/*.yml'
12+
workflow_dispatch:
813

914
jobs:
1015
build:

app/build.gradle

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
apply plugin: 'com.android.application'
22

3+
Properties props = new Properties()
4+
props.load(new FileInputStream(file("signing.properties")))
5+
36
android {
47
compileSdkVersion 29
58
buildToolsVersion "29.0.3"
@@ -16,12 +19,22 @@ android {
1619
}
1720
}
1821

22+
signingConfigs {
23+
release{
24+
keyAlias props['KEY_ALIAS']
25+
keyPassword props['KEY_PASSWORD']
26+
storeFile file(props['KEYSTORE_FILE'])
27+
storePassword props['KEYSTORE_PASSWORD']
28+
}
29+
}
30+
1931
buildTypes {
2032
release {
2133
buildConfigField "boolean", "LOG_DEBUG", "false" //不显示log
2234
shrinkResources false //资源压缩
2335
minifyEnabled false //混淆
2436
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
37+
signingConfig signingConfigs.release
2538
}
2639
}
2740

app/lin.jks

2.55 KB
Binary file not shown.

app/signing.properties

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
KEYSTORE_FILE = ./lin.jks
2+
KEYSTORE_PASSWORD = 123456
3+
KEY_ALIAS = lin
4+
KEY_PASSWORD = 123456

0 commit comments

Comments
 (0)