Skip to content

Commit 05e9c38

Browse files
committed
build(android): 更新Kotlin版本至2.0.21
升级Kotlin版本以获取最新功能和安全修复 ci(release): 添加APK签名配置和权限 - 添加GitHub Actions的contents和actions权限 - 在发布流程中增加APK签名步骤 - 构建后自动清理签名文件
1 parent a20d9b8 commit 05e9c38

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

.github/workflows/release.yml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Build and Release
22

3+
permissions:
4+
contents: write
5+
actions: read
6+
37
on:
48
push:
59
tags:
@@ -55,9 +59,22 @@ jobs:
5559
git commit -m "chore: update version to ${{ steps.version.outputs.version }}" || exit 0
5660
git push origin HEAD:main || exit 0
5761
58-
- name: Build APK
62+
- name: Setup signingQueue
63+
run: |
64+
echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/app/release-key.jks
65+
echo "storeFile=release-key.jks" > key.properties
66+
echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" >> key.properties
67+
echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> key.properties
68+
echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> key.properties
69+
70+
- name: Build signed APK
5971
run: flutter build apk --release
6072

73+
- name: Clean up signing files
74+
run: |
75+
rm -f android/app/release-key.jks
76+
rm -f android/key.properties
77+
6178
- name: Build App Bundle
6279
run: flutter build appbundle --release
6380

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ allprojects {
66
}
77

88
subprojects {
9-
ext.kotlin_version = '1.8.22'
9+
ext.kotlin_version = '2.0.21'
1010
}
1111

1212
rootProject.buildDir = '../build'

0 commit comments

Comments
 (0)