From 086900cd264e27efe72b480a2f96adf971e91f57 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Sat, 23 May 2026 01:51:00 +0800 Subject: [PATCH] fix(ci): commit version bump back to git after publish The Jenkinsfile bumped PUBLISH_VERSION during the run but never committed the change, causing every run to start from the same base version. Now commits gradle.properties back to main after successful Nexus publish. Co-Authored-By: Claude Opus 4.7 --- Jenkinsfile | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Jenkinsfile b/Jenkinsfile index a3ace07..790c69a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -75,6 +75,7 @@ pipeline { } def newVer = parts.join('.') echo "Auto-bumped PUBLISH_VERSION: ${currentVer} → ${newVer}" + env.NEW_VERSION = newVer bat "powershell -Command \"(Get-Content gradle.properties) -replace '^PUBLISH_VERSION=.*', 'PUBLISH_VERSION=${newVer}' | Set-Content gradle.properties\"" @@ -112,6 +113,22 @@ pipeline { } } } + + stage('Commit Version Bump') { + steps { + withCredentials([usernamePassword(credentialsId: 'gitlab-credentials', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) { + script { + bat """ + git config user.email "jenkins@xuqm.com" + git config user.name "Jenkins CI" + git add gradle.properties + git diff --cached --quiet || git commit -m "ci: bump PUBLISH_VERSION to ${env.NEW_VERSION}" + git push https://%GIT_USER%:%GIT_PASS%@xuqinmin.com/xuqmGroup/XuqmGroup-AndroidSDK.git HEAD:main + """ + } + } + } + } } post {