我正在尝试将我们的应用构建过程从AppCenter迁移到DevOps,并且配置文件有问题。我们的应用程序家族基本上是一个主模板,通过少量的配置更改即可构建多个应用程序,并且每个应用程序需要不同的配置文件集。
理想情况下,我想让配置文件自动从Apple Developer中提取,但是我找不到将帐户与DevOps关联的方法。我也无法让Fastlane的Spaceauth正常工作。
我想出的第二种选择是通过“安装Apple供应配置文件”任务并将.source设置为“存储库”,包括.mobileprovision文件(在运行时从安全主机上以编程方式提取)。在我的构建日志中,我看到正确导入了应用程序和通知配置文件,但是在构建时,fastlane(或xcode)抱怨它找不到该配置文件。 “安装Apple供应配置文件”和我的构建任务中的Bundle ID都匹配,所以我不确定是什么问题。
YAML示例:
steps:
- task: NodeTool@0
displayName: 'Use Node 10.15.3'
inputs:
versionSpec: 10.15.3
- task: Bash@3
displayName: 'Run Post Clone '
inputs:
targetType: filePath
filePath: './appcenter-post-clone.sh'
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
- task: CocoaPods@0
displayName: 'pod install'
inputs:
workingDirectory: ios
forceRepoUpdate: true
- bash: 'node node_modules/react-native/local-cli/cli.js bundle --entry-file=''index.js' --bundle-output='./ios/main.jsbundle' --dev=false - -platform='ios''
displayName: 'react-native bundle IOS'
#install provisioning profiles via repo
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provisioningProfileLocation: sourceRepository
provProfileSourceRepository: ./certs/app.mobileprovision
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provisioningProfileLocation: sourceRepository
provProfileSourceRepository: ./certs/notification.mobileprovision
# Install provisioning profiles via secure storage
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'app.mobileprovision'
removeProfile: false
- task: InstallAppleProvisioningProfile@1
displayName: 'Install an Apple provisioning profile'
inputs:
provProfileSecureFile: 'notification.mobileprovision'
removeProfile: false
# attempt build with fastlane
- bash: |
echo $FASTLANE_SESSION #tried setting spaceauth sessions to login to Apple Developer and fetch provisioning profiles
#fastlane spaceauth login
sudo gem install fastlane
fastlane gym --verbose --workspace "ios/*****.xcworkspace" --scheme "******"
displayName: 'Fastlane build IOS'
# attempt with xcode
- bash: |
xcodebuild "-workspace" "ios/*****.xcworkspace" "-scheme" "******" "-configuration" "Release" "DEVELOPMENT_TEAM=*******" "archive" "-archivePath" "*****.xcarchive" -allowProvisioningUpdates
# attempt with xcode 2 (with no signing)
- bash: |
xcodebuild "-workspace" "ios/*****.xcworkspace" "-scheme" "******" "-configuration" "Release" "DEVELOPMENT_TEAM=*******" "archive" "-archivePath" "*****.xcarchive" -allowProvisioningUpdates CODE_SIGNING_ALLOWED=NO
#resign with fastlane and include the cert. Fails with same error as above
- task: ms-vsclient.app-store.ipa-resign.IpaResign@1
displayName: 'Resign ipa file'
inputs:
ipaPath: output/build.ipa
signFileP12Path: certs/cert.p12
signFileP12Password: '****'
provFileProfilePath: ./certs/app.mobileprovision
# attempt with built in xcode command
- task: Xcode@5
displayName: 'Xcode build'
inputs:
configuration: 'Release DEVELOPMENT_TEAM=******* archive'
xcWorkspacePath: ios/*****.xcworkspace
scheme: ******
xcodeVersion: 10
packageApp: true
archivePath: *****.xcarchive