Skip to content

Commit

Permalink
Move signingConfig to package.properties
Browse files Browse the repository at this point in the history
  • Loading branch information
lightsummer233 committed May 11, 2024
1 parent 915998f commit 27ffc70
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ jobs:

- name: Create Sign File
run: |
echo releaseType=CI > package.properties
echo releaseType=CI >> package.properties
echo "${{ secrets.KEYSTORE_SECRET }}" | base64 -d > key.jks
echo "AKANE_RELEASE_STORE_FILE=${{ github.workspace }}/key.jks" >> gradle.properties
echo "AKANE_RELEASE_STORE_PASSWORD=${{ secrets.KEYSTORE_PWD }}" >> gradle.properties
echo "AKANE_RELEASE_KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> gradle.properties
echo "AKANE_RELEASE_KEY_PASSWORD=${{ secrets.KEY_PWD }}" >> gradle.properties
echo "AKANE_RELEASE_STORE_FILE=${{ github.workspace }}/key.jks" >> package.properties
echo "AKANE_RELEASE_STORE_PASSWORD=${{ secrets.KEYSTORE_PWD }}" >> package.properties
echo "AKANE_RELEASE_KEY_ALIAS=${{ secrets.KEY_ALIAS }}" >> package.properties
echo "AKANE_RELEASE_KEY_PASSWORD=${{ secrets.KEY_PWD }}" >> package.properties
- name: Build with Gradle
run: ./gradlew assembleRelease

- name: Find Apk
run: |
echo "APK_FILE=$(find app/build/outputs/apk/release -name '*.apk')" >> $GITHUB_ENV
echo "APK_FILE_NAME=$(basename ${{ env.APK_FILE }} .apk)" >> $GITHUB_ENV
export APK_FILE=$(find app/build/outputs/apk/release -name '*.apk')
echo "APK_FILE_NAME=$(basename $APK_FILE .apk)" >> $GITHUB_ENV
- name: Upload Apk
uses: actions/upload-artifact@v4
Expand Down
14 changes: 7 additions & 7 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ android {

signingConfigs {
create("release") {
if (project.hasProperty("AKANE_RELEASE_KEY_ALIAS")) {
storeFile = file(project.properties["AKANE_RELEASE_STORE_FILE"].toString())
storePassword = project.properties["AKANE_RELEASE_STORE_PASSWORD"].toString()
keyAlias = project.properties["AKANE_RELEASE_KEY_ALIAS"].toString()
keyPassword = project.properties["AKANE_RELEASE_KEY_PASSWORD"].toString()
if (readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_KEY_ALIAS") != null) {
storeFile = file(readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_STORE_FILE"))
storePassword = readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_STORE_PASSWORD")
keyAlias = readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_KEY_ALIAS")
keyPassword = readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_KEY_PASSWORD")
}
}
}
Expand Down Expand Up @@ -110,7 +110,7 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro",
)
if (project.hasProperty("AKANE_RELEASE_KEY_ALIAS")) {
if (readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_KEY_ALIAS") != null) {
signingConfig = signingConfigs["release"]
}
}
Expand All @@ -126,7 +126,7 @@ android {
}
debug {
isPseudoLocalesEnabled = true
if (project.hasProperty("AKANE_RELEASE_KEY_ALIAS")) {
if (readProperties(file("../package.properties")).getProperty("AKANE_RELEASE_KEY_ALIAS") != null) {
signingConfig = signingConfigs["release"]
}
}
Expand Down

0 comments on commit 27ffc70

Please sign in to comment.