Fix debug build if no key

This commit is contained in:
soraefir 2024-04-07 11:10:10 +02:00
parent 71acf04f20
commit 3fe83cff2e
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
2 changed files with 22 additions and 10 deletions

View File

@ -48,7 +48,7 @@ jobs:
cache: 'gradle'
- name: Build APK
run: ./gradlew assemble
run: ./gradlew assembleSignedRelease
# - name: Upload APK
# uses: actions/upload-artifact@v4
@ -61,4 +61,4 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
app/build/outputs/apk/release/app-release.apk
app/build/outputs/apk/signedRelease/app-release.apk

View File

@ -5,9 +5,6 @@ plugins {
id 'com.mikepenz.aboutlibraries.plugin' version '11.1.1'
}
def keystorePropertiesFile = rootProject.file("app/keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
namespace 'net.helcel.beans'
@ -20,22 +17,37 @@ android {
versionCode 1
versionName "0.1a"
}
signingConfigs {
create("release") {
try {
def keystorePropertiesFile = rootProject.file("app/keystore.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
} catch (FileNotFoundException e) {
println("File not found: ${e.message}")
}
}
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
signedRelease {
minifyEnabled true
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig = signingConfigs.getByName("release")
}
}