Skip to content

Commit

Permalink
Signing configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
t895 committed Sep 16, 2024
1 parent e4673f5 commit a43cffb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,11 @@ jobs:
- name: Give execution permissions to the gradle wrapper
run: chmod +x ./gradlew
- name: Build
run: ./gradlew :app:assembleRelease
env:
KEY_ALIAS: ${{secrets.KEY_ALIAS}}
KEY_PASSWORD: ${{secrets.KEY_PASSWORD}}
STORE_PASSWORD: ${{secrets.KEY_PASSWORD}}
run: |
echo "${{secrets.STORE_FILE}}" | base64 --decode > ${HOME}/keyfile.jks
export STORE_FILE_PATH=${HOME}/keyfile.jks
./gradlew :app:assembleRelease
15 changes: 15 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,23 @@ android {
versionName = "0.1.0"
}

val storeFilePath = System.getenv("STORE_FILE_PATH")
if (storeFilePath != null) {
signingConfigs {
create("release") {
keyAlias = System.getenv("KEY_ALIAS")
keyPassword = System.getenv("KEY_PASSWORD")
storeFile = file(storeFilePath)
storePassword = System.getenv("STORE_PASSWORD")
}
}
}

buildTypes {
release {
if (storeFilePath != null) {
signingConfig = signingConfigs.getByName("release")
}
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android.txt"),
Expand Down

0 comments on commit a43cffb

Please sign in to comment.