一大波改动
这个提交包含在:
父节点
60ac8f0283
当前提交
7217b6bcfc
14
Jenkinsfile
vendored
14
Jenkinsfile
vendored
@ -2,7 +2,6 @@ pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
string(name: 'BRANCH', defaultValue: 'main', description: 'Git 分支名')
|
||||
string(name: 'VERSION', defaultValue: '', description: '发布版本号(留空自动递增)')
|
||||
booleanParam(name: 'RUN_TESTS', defaultValue: true, description: '是否运行单元测试')
|
||||
booleanParam(name: 'PUBLISH_SPM', defaultValue: true, description: '发布 SPM 版本(打 Git Tag)')
|
||||
@ -23,7 +22,12 @@ pipeline {
|
||||
stages {
|
||||
stage('Checkout') {
|
||||
steps {
|
||||
checkout scm
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: 'main']],
|
||||
extensions: [[$class: 'CleanBeforeCheckout']],
|
||||
userRemoteConfigs: scm.userRemoteConfigs
|
||||
])
|
||||
script {
|
||||
env.GIT_COMMIT_SHORT = sh(script: 'git rev-parse --short HEAD', returnStdout: true).trim()
|
||||
if (params.VERSION?.trim()) {
|
||||
@ -74,11 +78,8 @@ pipeline {
|
||||
|
||||
stage('Publish SPM (Git Tag)') {
|
||||
when {
|
||||
allOf {
|
||||
branch 'main'
|
||||
expression { return params.PUBLISH_SPM }
|
||||
}
|
||||
}
|
||||
steps {
|
||||
withCredentials([usernamePassword(credentialsId: 'gitlab-credentials', passwordVariable: 'GIT_PASS', usernameVariable: 'GIT_USER')]) {
|
||||
sh """
|
||||
@ -95,11 +96,8 @@ pipeline {
|
||||
|
||||
stage('Publish CocoaPods') {
|
||||
when {
|
||||
allOf {
|
||||
branch 'main'
|
||||
expression { return params.PUBLISH_PODS }
|
||||
}
|
||||
}
|
||||
steps {
|
||||
sh """
|
||||
pod repo add xuqm-specs ${SPEC_REPO} 2>/dev/null || true
|
||||
|
||||
正在加载...
在新工单中引用
屏蔽一个用户