hopefully make prerelese signed

This commit is contained in:
Cloudburst 2021-08-18 12:31:16 +02:00
parent 761bb3aeb3
commit 7085413dca
2 changed files with 40 additions and 1 deletions

View file

@ -24,8 +24,19 @@ jobs:
run: |
COMMIT_HASH="$(git log -1 --format='%H')"
sed -i "s/<string name=\"prerelease_commit_hash\">unknown_prerelease<\/string>/<string name=\"prerelease_commit_hash\">$COMMIT_HASH<\/string>/g" app/src/main/res/values/strings.xml
- name: Decode Keystore
env:
ENCODED_STRING: ${{ secrets.KEYSTORE }}
run: |
TMP_KEYSTORE_FILE_PATH="${RUNNER_TEMP}"/keystore
mkdir -p "${TMP_KEYSTORE_FILE_PATH}"
echo $ENCODED_STRING | base64 -di > "${TMP_KEYSTORE_FILE_PATH}"/prerelease_keystore.jks
- name: Run Gradle
run: ./gradlew assembleDebug
run: ./gradlew app:assemblePrerelease
env:
SIGNING_KEY_ALIAS: ${{ secrets.SIGNING_KEY_ALIAS }}
SIGNING_KEY_PASSWORD: ${{ secrets.SIGNING_KEY_PASSWORD }}
SIGNING_STORE_PASSWORD: ${{ secrets.SIGNING_STORE_PASSWORD }}
- name: Create pre-release
uses: "marvinpinto/action-automatic-releases@latest"
with:

View file

@ -5,7 +5,27 @@ plugins {
id 'kotlin-android-extensions'
}
def tmpFilePath = System.getProperty("user.home") + "/work/_temp/keystore/"
def allFilesFromDir = new File(tmpFilePath).listFiles()
def prerelaseStoreFile = null
if (allFilesFromDir != null) {
prerelaseStoreFile = allFilesFromDir.first()
}
android {
signingConfigs {
prerelease {
if (prerelaseStoreFile != null) {
storeFile = file(prerelaseStoreFile)
storePassword System.getenv("SIGNING_STORE_PASSWORD")
keyAlias System.getenv("SIGNING_KEY_ALIAS")
keyPassword System.getenv("SIGNING_KEY_PASSWORD")
}
}
}
compileSdkVersion 30
buildToolsVersion "30.0.3"
@ -29,6 +49,14 @@ android {
debuggable true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
prerelease {
buildConfigField("boolean", "BETA", "true")
signingConfig signingConfigs.prerelease
versionNameSuffix '-PRE'
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8