Skip to content

Commit

Permalink
Use WYSIWYG version code
Browse files Browse the repository at this point in the history
  • Loading branch information
dyhkwong committed Sep 13, 2024
1 parent 91be748 commit fd174c5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/release_naive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
required: true
VERSION_NAME:
required: true
VERSION_CODE:
required: true
# publish:
# description: 'Release (y/n)'
# required: false
Expand Down Expand Up @@ -100,6 +102,7 @@ jobs:
echo "sdk.dir=${ANDROID_HOME}" > local.properties
export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}"
sed -i 's/NAIVE_VERSION_NAME=local/NAIVE_VERSION_NAME=${{ github.event.inputs.VERSION_NAME }}/' version.properties
sed -i 's/NAIVE_VERSION=1/NAIVE_VERSION=${{ github.event.inputs.VERSION_CODE }}/' version.properties
./gradlew :plugin:naive:assembleOssRelease
git restore version.properties
APK=$(find plugin/naive/build/outputs/apk -name '*arm64-v8a*.apk')
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Helpers.kt
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ fun Project.setupPlugin(projectName: String) {
val propPrefix = projectName.uppercase(Locale.ROOT)
val projName = projectName.lowercase(Locale.ROOT)
val verName = requireMetadata().getProperty("${propPrefix}_VERSION_NAME").trim()
val verCode = requireMetadata().getProperty("${propPrefix}_VERSION").trim().toInt() * 5
val verCode = requireMetadata().getProperty("${propPrefix}_VERSION").trim().toInt()
androidApp.defaultConfig {
versionName = verName
versionCode = verCode
Expand Down Expand Up @@ -297,7 +297,7 @@ fun Project.setupPlugin(projectName: String) {
fun Project.setupApp() {
val pkgName = requireMetadata().getProperty("PACKAGE_NAME").trim()
val verName = requireMetadata().getProperty("VERSION_NAME").trim()
val verCode = 153 * 5 + (requireMetadata().getProperty("VERSION_CODE").trim().toInt() - 153) * 2
val verCode = requireMetadata().getProperty("VERSION_CODE").trim().toInt()
androidApp.apply {
defaultConfig {
applicationId = pkgName
Expand Down
12 changes: 6 additions & 6 deletions version.properties
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
PACKAGE_NAME=com.github.dyhkwong.sagernet
VERSION_NAME=0.12.0-beta03
VERSION_CODE=230
VERSION_CODE=919

NAIVE_VERSION_NAME=local
NAIVE_VERSION=55
NAIVE_VERSION=1

BROOK_VERSION_NAME=20240606
BROOK_VERSION=9
BROOK_VERSION=45

HYSTERIA2_VERSION_NAME=2.5.1
HYSTERIA2_VERSION=22
HYSTERIA2_VERSION=110

MIERU_VERSION_NAME=3.4.0
MIERU_VERSION=26
MIERU_VERSION=130

JUICITY_VERSION_NAME=0.4.3
JUICITY_VERSION=1
JUICITY_VERSION=5

0 comments on commit fd174c5

Please sign in to comment.