Skip to content
This repository has been archived by the owner on Feb 17, 2024. It is now read-only.

Commit

Permalink
chore(CI): 无签名时使用 debug 签名
Browse files Browse the repository at this point in the history
  • Loading branch information
HuanCheng65 committed Feb 2, 2024
1 parent 66fa59a commit be3ae43
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
21 changes: 6 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -107,4 +98,4 @@ jobs:
uses: saurav-aggarwal/[email protected]
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
11 changes: 6 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 4 additions & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit be3ae43

Please sign in to comment.