From 2cb8a375d15a1b79cab6861a1e22d755a10e66ba Mon Sep 17 00:00:00 2001 From: Home Date: Mon, 30 Mar 2026 02:50:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4jenkins=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E6=B5=81=E6=B0=B4=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkinsfile.ios | 47 +++++++++++++++++++++++++++++++---------------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/Jenkinsfile.ios b/Jenkinsfile.ios index dbe8d8c9..f6185a85 100644 --- a/Jenkinsfile.ios +++ b/Jenkinsfile.ios @@ -94,31 +94,46 @@ pipeline { } } - stage('清理旧构建') { - steps { - sh "rm -rf dist/" // 清理 UniApp 打包生成的 dist 目录 - } - } + stage('安装iOS证书 & 描述文件') { steps { sh ''' # 解锁系统钥匙串(必须!) security unlock-keychain -p ${MAC_LOGIN_PWD} ~/Library/Keychains/login.keychain-db + # 导入 p12 证书到系统 + security import ${P12_FILE} \\ + -k ~/Library/Keychains/login.keychain-db \\ + -P ${P12_PASSWORD} \\ + -A \\ + -t cert + + # 允许Xcode调用签名 + security set-key-partition-list \\ + -S apple-tool:,apple:,codesign: \\ + -s -k ${MAC_LOGIN_PWD} \\ + ~/Library/Keychains/login.keychain-db + + # 安装描述文件到系统目录 + mkdir -p ~/Library/MobileDevice/Provisioning\\ Profiles + cp ${PROFILE_FILE} ~/Library/MobileDevice/Provisioning\\ Profiles/ + + echo "✅ 证书 + 描述文件 安装完成!" ''' } } - stage('开始归档项目') { - steps { - sh """ - xcodebuild archive \\ - -project ${APP_DIR}/${PROJECT_NAME}.xcodeproj \\ - -scheme ${SCHEME_NAME} \\ - -configuration ${CONFIGURATION} \\ - -archivePath ${ARCHIVE_PATH} - """ - } - } +// stage('开始归档项目') { +// steps { +// sh """ +// xcodebuild archive \\ +// -project ${APP_DIR}/${PROJECT_NAME}.xcodeproj \\ +// -scheme ${SCHEME_NAME} \\ +// -configuration ${CONFIGURATION} \\ +// -archivePath ${ARCHIVE_PATH} +// """ +// +// } +// } } post {