Skip to content

Commit

Permalink
更新CI可手动触发并自动签名APK
Browse files Browse the repository at this point in the history
  • Loading branch information
luoxingran committed Jun 22, 2024
1 parent fa2bcad commit a5e8871
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 2 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,14 @@ name: Android CI

on:
push:
branches: [ master ]
branches:
- master
pull_request:
branches: [ master ]
branches:
- master
paths:
- '.github/workflows/*.yml'
workflow_dispatch:

jobs:
build:
Expand Down
13 changes: 13 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
apply plugin: 'com.android.application'

Properties props = new Properties()
props.load(new FileInputStream(file("signing.properties")))

android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
Expand All @@ -16,12 +19,22 @@ android {
}
}

signingConfigs {
release{
keyAlias props['KEY_ALIAS']
keyPassword props['KEY_PASSWORD']
storeFile file(props['KEYSTORE_FILE'])
storePassword props['KEYSTORE_PASSWORD']
}
}

buildTypes {
release {
buildConfigField "boolean", "LOG_DEBUG", "false" //不显示log
shrinkResources false //资源压缩
minifyEnabled false //混淆
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}

Expand Down
Binary file added app/lin.jks
Binary file not shown.
4 changes: 4 additions & 0 deletions app/signing.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
KEYSTORE_FILE = ./lin.jks
KEYSTORE_PASSWORD = 123456
KEY_ALIAS = lin
KEY_PASSWORD = 123456

0 comments on commit a5e8871

Please sign in to comment.