Add signing on gradle
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Michel Roux 2022-09-16 14:29:42 +00:00
parent ebbb887e07
commit 7034d7f611
2 changed files with 20 additions and 7 deletions

View File

@ -6,20 +6,20 @@ steps:
- name: build - name: build
image: mingc/android-build-box image: mingc/android-build-box
commands: commands:
- curl -sSL -u "$USERNAME:$PASSWORD" -o $KEYFILE https://cloud.crystalyx.net/remote.php/dav/files/$USERNAME/Bordel/$KEYFILE - curl -sSL -u "$USERNAME:$PASSWORD" -o $STORE_FILE https://cloud.crystalyx.net/remote.php/dav/files/$USERNAME/Bordel/$STORE_FILE
- sh gradlew build bundle - sh gradlew build bundleRelease assembleRelease
- jarsigner -verbose -keystore $KEYFILE -storepass $KEYPASS -keypass $KEYPASS app/build/outputs/bundle/release/app-release.aab $KEYALIAS
- /opt/android-sdk/build-tools/30.0.2/apksigner sign -v --ks $KEYFILE --ks-key-alias $KEYALIAS --ks-pass pass:$KEYPASS --key-pass pass:$KEYPASS app/build/outputs/apk/debug/app-debug.apk
environment: environment:
USERNAME: USERNAME:
from_secret: nextcloud_user from_secret: nextcloud_user
PASSWORD: PASSWORD:
from_secret: nextcloud_password from_secret: nextcloud_password
KEYFILE: STORE_FILE:
from_secret: android_keyfile from_secret: android_keyfile
KEYALIAS: STORE_PASSWORD:
from_secret: android_keypass
KEY_ALIAS:
from_secret: android_keyalias from_secret: android_keyalias
KEYPASS: KEY_PASSWORD:
from_secret: android_keypass from_secret: android_keypass
- name: release - name: release
image: plugins/gitea-release image: plugins/gitea-release
@ -29,6 +29,7 @@ steps:
base_url: https://git.crystalyx.net base_url: https://git.crystalyx.net
files: files:
- app/build/outputs/apk/debug/app-debug.apk - app/build/outputs/apk/debug/app-debug.apk
- app/build/outputs/apk/release/app-release.apk
- app/build/outputs/bundle/release/app-release.aab - app/build/outputs/bundle/release/app-release.aab
when: when:
event: tag event: tag

View File

@ -14,10 +14,22 @@ android {
versionName "3.0" versionName "3.0"
} }
signingConfigs {
release {
if (System.env.STORE_FILE) {
storeFile file(System.env.STORE_FILE)
storePassword System.env.STORE_PASSWORD
keyAlias System.env.KEY_ALIAS
keyPassword System.env.KEY_PASSWORD
}
}
}
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
} }
} }