From 6f216bc4c291945a38b06cc3b2cc80d992a7bb62 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Thu, 18 Jun 2026 12:23:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(ci):=20SNAPSHOT=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E5=9F=BA=E4=BA=8E=E4=B8=8B=E4=B8=80=E7=89=88=E6=9C=AC=E5=8F=B7?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E4=B8=8E=E5=B7=B2=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=9A=84=20release=20=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - SNAPSHOT 模式:bumpVersion(baseVer) + '-SNAPSHOT',确保高于当前 release - 解决 Gradle 解析 SNAPSHOT 时优先使用同版本号 release 的问题 --- Jenkinsfile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 522b409..a094250 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -103,9 +103,9 @@ pipeline { def newVer if (params.SNAPSHOT) { - // SNAPSHOT:基础版本 + -SNAPSHOT,不写回 gradle.properties - newVer = baseVer + '-SNAPSHOT' - echo "SNAPSHOT: ${propName} → ${newVer}" + // SNAPSHOT:基于下一版本 + -SNAPSHOT,确保高于当前 release + newVer = bumpVersion(baseVer) + '-SNAPSHOT' + echo "SNAPSHOT: ${propName} → ${newVer} (base: ${baseVer})" } else { // Release:升级版本号,写回 gradle.properties newVer = bumpVersion(baseVer) @@ -135,7 +135,7 @@ pipeline { // sdk-bugcollect-plugin 是 JVM Gradle 插件,没有 assembleRelease 任务 def aarModules = modules.findAll { it != 'sdk-bugcollect-plugin' } if (aarModules.isEmpty()) { - echo "没有 AAR 模块需要构建" + bat 'chcp 65001 >nul && echo 没有AAR模块需要构建' } else { def moduleTasks = aarModules.collect { ":${it}:assembleRelease" }.join(' ') bat "gradlew.bat ${moduleTasks} ${env.VERSION_ARGS} --no-daemon" @@ -173,9 +173,9 @@ pipeline { post { success { - echo "Android SDK 构建成功" - echo "发布版本:\n${env.PUBLISHED_VERSIONS}" + bat 'chcp 65001 >nul && echo Android SDK 构建成功' + bat "chcp 65001 >nul && echo 发布版本: ${env.PUBLISHED_VERSIONS}" } - failure { echo "Android SDK 构建失败" } + failure { bat 'chcp 65001 >nul && echo Android SDK 构建失败' } } }