From be3ae4360251661d1c959cf4dc6ae81ea2558fb1 Mon Sep 17 00:00:00 2001 From: HuanCheng65 <22636177+HuanCheng65@users.noreply.github.com> Date: Fri, 2 Feb 2024 19:13:55 +0800 Subject: [PATCH] =?UTF-8?q?chore(CI):=20=E6=97=A0=E7=AD=BE=E5=90=8D?= =?UTF-8?q?=E6=97=B6=E4=BD=BF=E7=94=A8=20debug=20=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 21 ++++++--------------- app/build.gradle.kts | 11 ++++++----- settings.gradle.kts | 5 ++++- 3 files changed, 16 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94b74225..6912ac53 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,10 +30,10 @@ jobs: if: ${{ github.event_name != 'pull_request' || github.ref_type == 'tag' }} run: | if [ -n "${{ secrets.RELEASEKEYPASSWORD }}" ]; then - echo releaseKeyAlias="${{ vars.RELEASE_KEY_ALIAS }}" >> keystore.properties - echo releaseKeyPassword="${{ secrets.RELEASEKEYPASSWORD }}" >> keystore.properties - echo releaseKeyStore="${{ vars.RELEASE_KEYSTORE }}" >> keystore.properties - echo releaseStorePassword="${{ secrets.RELEASESTOREPASSWORD }}" >> keystore.properties + echo keystore.file="${{ vars.RELEASE_KEYSTORE }}" >> keystore.properties + echo keystore.password="${{ secrets.RELEASESTOREPASSWORD }}" >> keystore.properties + echo keystore.key.alias="${{ vars.RELEASE_KEY_ALIAS }}" >> keystore.properties + echo keystore.key.password="${{ secrets.RELEASEKEYPASSWORD }}" >> keystore.properties fi - name: Setup Gradle @@ -43,7 +43,7 @@ jobs: cache-read-only: ${{ github.ref != 'refs/heads/master' && github.ref != 'refs/heads/4.0-dev' }} - name: Build with Gradle - run: ./gradlew assemble + run: ./gradlew assembleRelease - name: Read Output Metadata id: read_output_metadata @@ -61,15 +61,6 @@ jobs: name: "release-${{ env.version_name }}(${{ env.version_code }})" path: ./app/build/outputs/apk/release - - name: Upload Debug Package - env: - version_code: ${{ fromJSON(steps.read_output_metadata.outputs.content).elements[0].versionCode }} - version_name: ${{ fromJSON(steps.read_output_metadata.outputs.content).elements[0].versionName }} - uses: actions/upload-artifact@v3 - with: - name: "debug-${{ env.version_name }}(${{ env.version_code }})" - path: ./app/build/outputs/apk/debug - - name: Upload Mapping uses: actions/upload-artifact@v4 with: @@ -107,4 +98,4 @@ jobs: uses: saurav-aggarwal/appcenter-cli-action@1.0.1 with: token: ${{ secrets.APP_CENTER_TOKEN }} - command: appcenter crashes upload-mappings -c ${{ env.version_code }} -n ${{ env.version_name }} -m ${{ github.workspace }}/app/build/outputs/mapping/release/mapping.txt -a ${{ secrets.APP_CENTER_APP }} + command: appcenter crashes upload-mappings -c ${{ env.version_code }} -n ${{ env.version_name }} -m /github/workspace/app/build/outputs/mapping/release/mapping.txt -a huanchengfly/TiebaLite diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 76a63683..94159537 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -54,12 +54,13 @@ android { compose = true } signingConfigs { - if (property.releaseKeyStore.isNotEmpty()) { + println("keystore.file: ${property.keystore.file}") + if (property.keystore.file.isNotBlank()) { val config by creating { - keyAlias = property.releaseKeyAlias - keyPassword = property.releaseKeyPassword - storeFile = file(File(rootDir, property.releaseKeyStore)) - storePassword = property.releaseStorePassword + storeFile = file(File(rootDir, property.keystore.file)) + storePassword = property.keystore.password + keyAlias = property.keystore.key.alias + keyPassword = property.keystore.key.password enableV3Signing = true enableV4Signing = true } diff --git a/settings.gradle.kts b/settings.gradle.kts index 44cdc3c6..92effc7d 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -26,7 +26,10 @@ sweetProperty { isAddDefault = true ) permanentKeyValues( - "releaseKeyStore" to "" + "keystore.file" to "", + "keystore.password" to "", + "keystore.key.alias" to "", + "keystore.key.password" to "" ) generateFrom(CURRENT_PROJECT, ROOT_PROJECT) }