Skip to content

Commit 03d8f38

Browse files
committed
build: fix build for kts
1 parent 39e8f07 commit 03d8f38

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ jobs:
1818
distribution: 'temurin'
1919
- name: Load keystore
2020
run: |
21-
mkdir gradle-config && \
22-
echo "${{ secrets.KEYSTORE_FILE_CONTENTS }}" | base64 -d > gradle-config/keystore && \
23-
cat <<EOL > gradle-config/gradle.properties
24-
RELEASE_STORE_FILE=$PWD/gradle-config/keystore
25-
RELEASE_STORE_PASSWORD=${{ secrets.RELEASE_STORE_PASSWORD }}
26-
RELEASE_KEY_ALIAS=${{ secrets.RELEASE_KEY_ALIAS }}
27-
RELEASE_KEY_PASSWORD=${{ secrets.RELEASE_KEY_PASSWORD }}
21+
echo "${{ secrets.KEYSTORE_FILE_CONTENTS }}" | base64 -d > keystore.jks && \
22+
cat <<EOL > local.properties
23+
storeFilePath=keystore.jks
24+
storePassword=${{ secrets.RELEASE_STORE_PASSWORD }}
25+
keyAlias=${{ secrets.RELEASE_KEY_ALIAS }}
26+
keyPassword=${{ secrets.RELEASE_KEY_PASSWORD }}
2827
EOL
2928
- name: Build Release APK
3029
run: ./gradlew assembleRelease

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@
1313
.externalNativeBuild
1414
.cxx
1515
local.properties
16+
keystore.jks

app/build.gradle.kts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import org.jetbrains.kotlin.konan.properties.Properties
2+
13
plugins {
24
id("com.android.application")
35
id("org.jetbrains.kotlin.android")
@@ -21,11 +23,14 @@ android {
2123
}
2224

2325
signingConfigs {
24-
release {
25-
storeFile file(RELEASE_STORE_FILE)
26-
storePassword RELEASE_STORE_PASSWORD
27-
keyAlias RELEASE_KEY_ALIAS
28-
keyPassword RELEASE_KEY_PASSWORD
26+
create("release") {
27+
val properties = Properties().apply {
28+
load(File("local.properties").reader())
29+
}
30+
storeFile = File(properties.getProperty("storeFilePath"))
31+
storePassword = properties.getProperty("storePassword")
32+
keyPassword = properties.getProperty("keyPassword")
33+
keyAlias = properties.getProperty("keyAlias")
2934
}
3035
}
3136

@@ -36,7 +41,7 @@ android {
3641
getDefaultProguardFile("proguard-android-optimize.txt"),
3742
"proguard-rules.pro"
3843
)
39-
signingConfig signingConfigs.release
44+
signingConfig = signingConfigs.getByName("release")
4045
}
4146
}
4247
compileOptions {

0 commit comments

Comments
 (0)