一大波改动

这个提交包含在:
XuqmGroup 2026-05-16 12:48:17 +08:00
父节点 60ac8f0283
当前提交 7217b6bcfc

14
Jenkinsfile vendored
查看文件

@ -2,7 +2,6 @@ pipeline {
agent any agent any
parameters { parameters {
string(name: 'BRANCH', defaultValue: 'main', description: 'Git 分支名')
string(name: 'VERSION', defaultValue: '', description: '发布版本号(留空自动递增)') string(name: 'VERSION', defaultValue: '', description: '发布版本号(留空自动递增)')
booleanParam(name: 'RUN_TESTS', defaultValue: true, description: '是否运行单元测试') booleanParam(name: 'RUN_TESTS', defaultValue: true, description: '是否运行单元测试')
booleanParam(name: 'PUBLISH_SPM', defaultValue: true, description: '发布 SPM 版本(打 Git Tag') booleanParam(name: 'PUBLISH_SPM', defaultValue: true, description: '发布 SPM 版本(打 Git Tag')
@ -23,7 +22,12 @@ pipeline {
stages { stages {
stage('Checkout') { stage('Checkout') {
steps { steps {
checkout scm checkout([
$class: 'GitSCM',
branches: [[name: 'main']],
extensions: [[$class: 'CleanBeforeCheckout']],
userRemoteConfigs: scm.userRemoteConfigs
])
script { script {
env.GIT_COMMIT_SHORT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim() env.GIT_COMMIT_SHORT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
if (params.VERSION?.trim()) { if (params.VERSION?.trim()) {
@ -74,11 +78,8 @@ pipeline {
stage('Publish SPM (Git Tag)') { stage('Publish SPM (Git Tag)') {
when { when {
allOf {
branch 'main'
expression { return params.PUBLISH_SPM } expression { return params.PUBLISH_SPM }
} }
}
steps { steps {
withCredentials([usernamePassword(credentialsId: 'gitlab-credentials', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) { withCredentials([usernamePassword(credentialsId: 'gitlab-credentials', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
sh """ sh """
@ -95,11 +96,8 @@ pipeline {
stage('Publish CocoaPods') { stage('Publish CocoaPods') {
when { when {
allOf {
branch 'main'
expression { return params.PUBLISH_PODS } expression { return params.PUBLISH_PODS }
} }
}
steps { steps {
sh """ sh """
pod repo add xuqm-specs ${SPEC_REPO} 2>/dev/null || true pod repo add xuqm-specs ${SPEC_REPO} 2>/dev/null || true