feat: 配置Android签名与APK后缀大写

新增release.keystore并在build.gradle中配置签名信息,发布包启用签名。统一Android APK文件后缀为大写.APK,调整CI流程相关路径匹配。
This commit is contained in:
谦君
2025-12-20 01:32:48 +08:00
parent 3fe1e4a347
commit 859418e50c
3 changed files with 13 additions and 3 deletions

View File

@@ -111,7 +111,7 @@ jobs:
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: android-apk name: android-apk
path: android/app/build/outputs/apk/release/*.apk path: android/app/build/outputs/apk/release/*.APK
# 3. 构建 Electron 客户端 # 3. 构建 Electron 客户端
build-electron: build-electron:
@@ -189,7 +189,7 @@ jobs:
find ./raw-assets/electron-* -type f \( -name "*.exe" -o -name "*.dmg" -o -name "*.AppImage" -o -name "*.zip" \) -exec cp {} ./final-release/ \; find ./raw-assets/electron-* -type f \( -name "*.exe" -o -name "*.dmg" -o -name "*.AppImage" -o -name "*.zip" \) -exec cp {} ./final-release/ \;
# 移动 Android APK # 移动 Android APK
find ./raw-assets/android-apk -type f -name "*.apk" -exec cp {} ./final-release/ \; || true find ./raw-assets/android-apk -type f -name "*.APK" -exec cp {} ./final-release/ \; || true
# 检查结果 # 检查结果
echo "Final assets to upload:" echo "Final assets to upload:"

View File

@@ -27,11 +27,21 @@ android {
} }
} }
signingConfigs {
release {
storeFile file('release.keystore')
storePassword 'ogame123'
keyAlias 'ogame'
keyPassword 'ogame123'
}
}
buildTypes { buildTypes {
release { release {
minifyEnabled true minifyEnabled true
shrinkResources true shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
} }
} }
@@ -46,7 +56,7 @@ android {
def abi = output.getFilter(com.android.build.OutputFile.ABI) def abi = output.getFilter(com.android.build.OutputFile.ABI)
if (abi != null) { if (abi != null) {
output.versionCodeOverride = abiVersionCode[abi] * 1000 + defaultConfig.versionCode output.versionCodeOverride = abiVersionCode[abi] * 1000 + defaultConfig.versionCode
output.outputFileName = "OGame-${defaultConfig.versionName}-${abi}.apk" output.outputFileName = "OGame-${defaultConfig.versionName}-${abi}.APK"
} }
} }
} }

Binary file not shown.