Skip to content

Commit 51bcc10

Browse files
committed
优化CI产物命名和发布工作流
1 parent b949b00 commit 51bcc10

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ jobs:
2727
keyPassword: ${{ secrets.KEY_PASSWORD }}
2828
env:
2929
BUILD_TOOLS_VERSION: "34.0.0"
30-
- run: mv ${{steps.sign_app.outputs.signedReleaseFile}} ClipboardSync_$GITHUB_REF_NAME.apk
3130
- uses: ncipollo/release-action@v1
3231
with:
33-
artifacts: "*.apk"
32+
artifacts: "app/build/outputs/apk/release/*-signed.apk"
3433
token: ${{ github.token }}
3534
generateReleaseNotes: true

app/build.gradle.kts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ android {
3535
}
3636
}
3737

38+
applicationVariants.all {
39+
val variant = this
40+
if (variant.buildType.name == "release")
41+
variant.outputs.map { it as com.android.build.gradle.internal.api.BaseVariantOutputImpl }
42+
.forEach { output ->
43+
val abi = output.getFilter(com.android.build.OutputFile.ABI) ?: "universal"
44+
val apkName = "cs-${defaultConfig.versionName}-${abi}-${variant.buildType.name}.apk"
45+
output.outputFileName = apkName
46+
}
47+
}
48+
3849
compileOptions {
3950
sourceCompatibility = JavaVersion.VERSION_11
4051
targetCompatibility = JavaVersion.VERSION_11

0 commit comments

Comments
 (0)