From 67d00af0168ebdfb5112ea3fab371ae32f5e2f33 Mon Sep 17 00:00:00 2001 From: BinTianqi Date: Sat, 25 May 2024 18:47:45 +0800 Subject: [PATCH] ci: fix unable to read secrets grant exec permission to gradlew --- .github/workflows/build.yml | 11 ++++------- app/build.gradle.kts | 15 ++++++--------- gradlew | 0 3 files changed, 10 insertions(+), 16 deletions(-) mode change 100644 => 100755 gradlew diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9300b4..3b2519d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,9 +23,6 @@ jobs: - name: Get short commit SHA run: echo "SHORT_SHA=${GITHUB_SHA::7}" >> $GITHUB_ENV - - name: Grant execution permission to Gradle Wrapper - run: chmod +x gradlew - - name: Build APK (testkey) run: ./gradlew build @@ -43,14 +40,14 @@ jobs: - name: Export key env: - KEY_BASE64: ${{ secret.KEY_BASE64 }} + KEY_BASE64: ${{ secrets.KEY_BASE64 }} run: echo $KEY_BASE64 | base64 --decode - > app/signature.jks - name: Build APK env: - KEYSTORE_PASSWORD: ${{ secret.KEYSTORE_PASSWORD }} - KEY_PASSWORD: ${{ secret.KEY_PASSWORD }} - KEY_ALIAS: ${{ secret.KEY_ALIAS }} + KEYSTORE_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }} + KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} + KEY_ALIAS: ${{ secrets.KEY_ALIAS }} run: ./gradlew build - name: Upload Debug APK diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 11852a2..6341eca 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -9,11 +9,11 @@ var keyAlias: String? = null android { signingConfigs { - create("testkey") { + create("defaultSignature") { storeFile = file("signature.jks") - storePassword = keystorePassword ?: "testkey" - keyPassword = keyPassword ?: "testkey" - keyAlias = keyAlias ?: "testkey" + storePassword = System.getenv("KEYSTORE_PASSWORD") ?: "testkey" + keyPassword = System.getenv("KEY_PASSWORD") ?: "testkey" + keyAlias = System.getenv("KEY_ALIAS") ?: "testkey" } } namespace = "com.bintianqi.owndroid" @@ -39,10 +39,10 @@ android { getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) - signingConfig = signingConfigs.getByName("testkey") + signingConfig = signingConfigs.getByName("defaultSignature") } debug { - signingConfig = signingConfigs.getByName("testkey") + signingConfig = signingConfigs.getByName("defaultSignature") } } compileOptions { @@ -86,9 +86,6 @@ tasks.register("prepareSignature") { file("signature.jks").let { if(!it.exists()) file("testkey.jks").copyTo(it) } - keystorePassword = System.getenv("KEYSTORE_PASSWORD") - keyAlias = System.getenv("KEY_ALIAS") - keyPassword = System.getenv("KEY_PASSWORD") } } diff --git a/gradlew b/gradlew old mode 100644 new mode 100755