From c60bc15a93330de20f5dc081113b976d615fbdc8 Mon Sep 17 00:00:00 2001 From: XuqmGroup Date: Sat, 23 May 2026 01:54:28 +0800 Subject: [PATCH] fix(ci): fix version bump and git push MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Strip \r\n from PowerShell output to fix version parsing (was causing "1.0.3 → 1.0.3" instead of "1.0.3 → 1.0.4") - Remove gitlab-credentials dependency, use git remote URL which already has the access token embedded Co-Authored-By: Claude Opus 4.7 --- Jenkinsfile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 790c69a..0fd41d2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -53,7 +53,7 @@ pipeline { def currentVer = bat( script: "@powershell -Command \"(Get-Content gradle.properties | Select-String '^PUBLISH_VERSION=').Line.Split('=')[1]\"", returnStdout: true - ).trim() + ).replaceAll("\\r","").replaceAll("\\n","").trim() echo "Current PUBLISH_VERSION: ${currentVer}" def parts = currentVer.tokenize('.') @@ -116,16 +116,14 @@ 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 - """ - } + 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 origin main + """ } } }