提交jenkins自动化流水线

This commit is contained in:
Home
2026-03-29 23:43:29 +08:00
parent a7b2df96fd
commit 378b53fb11
+20 -3
View File
@@ -11,6 +11,7 @@ pipeline {
SCHEME_NAME = 'HBuilder' SCHEME_NAME = 'HBuilder'
CONFIGURATION = 'Release' CONFIGURATION = 'Release'
ARCHIVE_PATH = "${APP_DIR}//build/HBuilder.xcarchive" //归档文件输出路径
} }
stages { stages {
stage('打印环境变量') { stage('打印环境变量') {
@@ -73,14 +74,30 @@ pipeline {
// } // }
// } // }
// ====================== 构建 IPA ====================== // ====================== 构建 IPA ======================
stage('配置SDK & 赋予权限 & 编译IOS') { stage('========== 🗑️清理旧构建内容 ==========') {
steps { steps {
echo "========== 🗑️清理旧构建内容 =========="
sh """ sh """
xcodebuild clean \\ xcodebuild clean \\
-project ${APP_DIR}/${projectName}.xcodeproj \\ -project ${APP_DIR}/${projectName}.xcodeproj \\
-scheme ${SCHEME_NAME} \\ -scheme ${SCHEME_NAME} \\
-configuration ${configuration} -configuration ${CONFIGURATION} \\
MARKETING_VERSION=${versionName} \\
CURRENT_PROJECT_VERSION=${versionCode} \\
-destination 'generic/platform=iOS \\
archive
"""
}
}
stage('开始归档项目') {
steps {
sh """
xcodebuild archive \\
-project ${APP_DIR}/${projectName}.xcodeproj \\
-scheme ${SCHEME_NAME} \\
-configuration ${CONFIGURATION} \\
-archivePath ${ARCHIVE_PATH} \\
""" """
} }