Skip to content

Commit

Permalink
Merge pull request #120 from imashnake0/sign-release
Browse files Browse the repository at this point in the history
Sign release builds
  • Loading branch information
imashnake0 authored Jan 17, 2024
2 parents 9e1d336 + 78c612d commit a4d772a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/create-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ jobs:
java-version: 17
cache: 'gradle'

- name: Prepare signing keystore
uses: mobiledevops/secret-to-file-action@v1
with:
base64-encoded-secret: ${{ secrets.KEYSTORE_CONTENT }}
filename: "keystore.jks"

- name: Build App
run: ./gradlew assembleRelease
env:
ORG_GRADLE_PROJECT_storeFilePath: "../keystore.jks"
ORG_GRADLE_PROJECT_storePass: ${{ secrets.KEYSTORE_PASSWORD }}
ORG_GRADLE_PROJECT_key: ${{ secrets.KEY_ALIAS }}
ORG_GRADLE_PROJECT_keyPass: ${{ secrets.KEY_PASSWORD }}

- name: Release
uses: softprops/action-gh-release@v1
Expand Down
17 changes: 16 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,26 @@ android {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
register("release") {
val storeFilePath: String? by project
val storePass: String? by project
val key: String? by project
val keyPass: String? by project
this.storeFile = storeFilePath?.let { file(it) }
this.storePassword = storePass
this.keyAlias = key
this.keyPassword = keyPass
}
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
signingConfig = signingConfigs.getByName("debug")
signingConfig = signingConfigs.getByName(
if (System.getenv("Animite") == "true") "release" else "debug"
)
}
}

Expand Down

0 comments on commit a4d772a

Please sign in to comment.