refactor(ci): 移除自定义版本号功能,仅保留自动升级
这个提交包含在:
父节点
d57a6417ca
当前提交
7606a71525
35
Jenkinsfile
vendored
35
Jenkinsfile
vendored
@ -5,17 +5,6 @@ pipeline {
|
||||
// ── 版本升级策略 ─────────────────────────────────────────────────────
|
||||
choice(name: 'VERSION_BUMP', choices: ['patch', 'minor', 'major'],
|
||||
description: '版本升级策略: major(1.0.0→2.0.0), minor(1.0.0→1.1.0), patch(1.0.0→1.0.1)')
|
||||
booleanParam(name: 'CUSTOM_VERSION', defaultValue: false,
|
||||
description: '勾选后使用下方自定义版本号(忽略VERSION_BUMP)')
|
||||
|
||||
// ── 模块自定义版本号(仅CUSTOM_VERSION=true时生效)───────────────────
|
||||
string(name: 'CORE_VERSION', defaultValue: '', description: 'XuqmCoreSDK 自定义版本号(仅CUSTOM_VERSION=true时生效)')
|
||||
string(name: 'IM_VERSION', defaultValue: '', description: 'XuqmImSDK 自定义版本号')
|
||||
string(name: 'PUSH_VERSION', defaultValue: '', description: 'XuqmPushSDK 自定义版本号')
|
||||
string(name: 'UPDATE_VERSION', defaultValue: '', description: 'XuqmUpdateSDK 自定义版本号')
|
||||
string(name: 'LICENSE_VERSION', defaultValue: '', description: 'XuqmLicenseSDK 自定义版本号')
|
||||
string(name: 'FILE_VERSION', defaultValue: '', description: 'XuqmFileSDK 自定义版本号')
|
||||
string(name: 'WEBVIEW_VERSION', defaultValue: '', description: 'XuqmWebViewSDK 自定义版本号')
|
||||
|
||||
// ── 模块选择(勾选即发布)─────────────────────────────────────────
|
||||
booleanParam(name: 'MOD_CORE', defaultValue: true, description: '发布 XuqmCoreSDK')
|
||||
@ -92,15 +81,6 @@ pipeline {
|
||||
script {
|
||||
def moduleMap = new groovy.json.JsonSlurper().parseText(env.MODULE_MAP)
|
||||
def modules = env.SELECTED_MODULES.split(',')
|
||||
def customVersions = [
|
||||
'core': params.CORE_VERSION?.trim(),
|
||||
'im': params.IM_VERSION?.trim(),
|
||||
'push': params.PUSH_VERSION?.trim(),
|
||||
'update': params.UPDATE_VERSION?.trim(),
|
||||
'license': params.LICENSE_VERSION?.trim(),
|
||||
'file': params.FILE_VERSION?.trim(),
|
||||
'webview': params.WEBVIEW_VERSION?.trim(),
|
||||
]
|
||||
|
||||
for (mod in modules) {
|
||||
def podspecFile = "${moduleMap[mod].podspec}.podspec"
|
||||
@ -109,11 +89,6 @@ pipeline {
|
||||
returnStdout: true
|
||||
).trim()
|
||||
|
||||
def newVer = ''
|
||||
if (params.CUSTOM_VERSION && customVersions[mod]) {
|
||||
// 使用自定义版本号
|
||||
newVer = customVersions[mod]
|
||||
} else if (!params.CUSTOM_VERSION) {
|
||||
// 根据 VERSION_BUMP 策略自动升级版本号
|
||||
def parts = currentVer.tokenize('.')
|
||||
while (parts.size() < 3) { parts.add('0') }
|
||||
@ -132,17 +107,11 @@ pipeline {
|
||||
parts[2] = (parts[2].toInteger() + 1).toString()
|
||||
break
|
||||
}
|
||||
newVer = parts.join('.')
|
||||
}
|
||||
def newVer = parts.join('.')
|
||||
|
||||
if (newVer && newVer != currentVer) {
|
||||
echo "Bumping ${moduleMap[mod].podspec}: ${currentVer} → ${newVer}"
|
||||
sh "sed -i '' 's/s.version.*= .*/s.version = \"${newVer}\"/' ${podspecFile}"
|
||||
env["VERSION_${mod}"] = newVer
|
||||
} else {
|
||||
echo "Keeping ${moduleMap[mod].podspec} at ${currentVer}"
|
||||
env["VERSION_${mod}"] = currentVer
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -154,7 +123,7 @@ pipeline {
|
||||
def modules = env.SELECTED_MODULES.split(',')
|
||||
def moduleMap = new groovy.json.JsonSlurper().parseText(env.MODULE_MAP)
|
||||
echo "Git Commit : ${env.GIT_COMMIT_SHORT}"
|
||||
echo "Bump Strategy: ${params.CUSTOM_VERSION ? 'Custom' : params.VERSION_BUMP}"
|
||||
echo "Bump Strategy: ${params.VERSION_BUMP}"
|
||||
echo "Modules (${modules.size()}):"
|
||||
for (mod in modules) {
|
||||
def ver = env["VERSION_${mod}"]
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户