Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,11 @@ jobs:
BUILD_TOOLS=$(ls -d $ANDROID_HOME/build-tools/*/ | sort -V | tail -1)
APK=app/build/outputs/apk/debug/app-debug.apk
VERSION_NAME=$("$BUILD_TOOLS/aapt2" dump badging "$APK" | grep -oE "versionName='[^']+'" | head -1 | sed "s/versionName='//;s/'//")
echo "APK versionName: $VERSION_NAME ; Tag: $TAG"
if [ "$VERSION_NAME" != "$TAG" ]; then
echo "::error::APK versionName ($VERSION_NAME) 与 Tag ($TAG) 不一致(§4.10)"
# Tag 形如 v0.2.8-debug,versionName 形如 0.2.8-debug;去掉 tag 的 v 前缀再比对
TAG_VERSION="${TAG#v}"
echo "APK versionName: $VERSION_NAME ; Tag: $TAG (normalized: $TAG_VERSION)"
if [ "$VERSION_NAME" != "$TAG_VERSION" ]; then
echo "::error::APK versionName ($VERSION_NAME) 与 Tag ($TAG_VERSION) 不一致(§4.10)"
exit 1
fi

Expand Down
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ android {
targetSdk = 34
// 版本号与 GitHub Release tag 对齐:versionCode 单调递增,
// versionName 形如 "0.2.4-debug"。改版本时记得同步发对应 tag。
versionCode = 28
versionName = "0.2.8-debug"
versionCode = 29
versionName = "0.2.9-debug"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables { useSupportLibrary = true }
}
Expand Down
Loading