From b4610d9dd889721a701b07c26199f46d7e9dd08e Mon Sep 17 00:00:00 2001 From: Home Date: Mon, 30 Mar 2026 03:13:53 +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 | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile.ios b/Jenkinsfile.ios index 28110fb2..8f59ad00 100644 --- a/Jenkinsfile.ios +++ b/Jenkinsfile.ios @@ -65,6 +65,24 @@ pipeline { echo "✅ 版本号:${env.versionCode}" } } + stage('安装证书 & 描述文件') { + steps { + sh ''' + # =============== 安装 p12 证书 =============== + security unlock-keychain -p ${MAC_LOGIN_PWD} ~/Library/Keychains/login.keychain-db + security import ${P12_FILE} -k ~/Library/Keychains/login.keychain-db -P ${P12_PASSWORD} -A + 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 "✅ 描述文件已安装到系统目录" + ls -la ~/Library/MobileDevice/Provisioning\ Profiles/ + ''' + } + } // stage('打包uniapp') { // steps { // sh "npm run build:app-plus:${env.BRANCH_NAME}" @@ -81,17 +99,17 @@ pipeline { // } // } // ====================== 构建 IPA ====================== - stage('========== 🗑️清理旧构建内容 ==========') { - steps { - sh """ - xcodebuild clean \\ - -project ${APP_DIR}/${PROJECT_NAME}.xcodeproj \\ - -scheme ${SCHEME_NAME} \\ - -configuration ${CONFIGURATION} - """ - - } - } +// stage('========== 🗑️清理旧构建内容 ==========') { +// steps { +// sh """ +// xcodebuild clean \\ +// -project ${APP_DIR}/${PROJECT_NAME}.xcodeproj \\ +// -scheme ${SCHEME_NAME} \\ +// -configuration ${CONFIGURATION} +// """ +// +// } +// } // stage('开始归档项目') { // steps {