提交jenkins自动化流水线

This commit is contained in:
Home
2026-03-30 02:50:10 +08:00
parent 2b7e697570
commit 2cb8a375d1
+31 -16
View File
@@ -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 {