GitHub操作IOS xcode QA/Staging并发布证书和配置文件
我正在使用xcode 11.3为IOS使用GitHub操作。我能够为开发环境构建、导出存档并推送到应用程序中心。但是,我在登台/质量保证环境中遇到了错误 如果我提供的证书和配置文件与我在staging/QA中用于dev环境的证书和配置文件相同,那么在导出归档文件时会出现错误(构建成功):- 如果我在apple开发者帐户中创建新证书(apple分发)和规定文件(临时分发)。导出文件并转换文件,然后在GitHub操作中上载.p12.gpg和mobileprovision.gpg。生成时,我收到错误:-GitHub操作IOS xcode QA/Staging并发布证书和配置文件,ios,xcode,github,github-actions,Ios,Xcode,Github,Github Actions,我正在使用xcode 11.3为IOS使用GitHub操作。我能够为开发环境构建、导出存档并推送到应用程序中心。但是,我在登台/质量保证环境中遇到了错误 如果我提供的证书和配置文件与我在staging/QA中用于dev环境的证书和配置文件相同,那么在导出归档文件时会出现错误(构建成功):- 如果我在apple开发者帐户中创建新证书(apple分发)和规定文件(临时分发)。导出文件并转换文件,然后在GitHub操作中上载.p12.gpg和mobileprovision.gpg。生成时,我收到错误:
#Build archives
##[error]Process completed with exit code 65.
Run xcodebuild archive -workspace abc.xcworkspace -scheme abcStaging -archivePath abc.xcarchive
User defaults from command line:
IDEArchivePathOverride = /Users/runner/runners/2.169.0/work/abcappIOS-v1.0/abcappIOS-v1.0/abc.xcarchive
note: Using new build system
note: Planning build
note: Constructing build description
error: No profiles for 'com.abc.Staging' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.abc.Staging'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'abc' from project 'abc')
** ARCHIVE FAILED **
##[error]Process completed with exit code 65.
我在导出存档中提供了-allowProvisioningUpdates作为参数,但错误仍然存在
下面是github操作的代码
name: Deploy iOS to App Center
on:
push:
branches: [ staging ]
pull_request:
branches: [ staging ]
jobs:
build:
runs-on: macOS-latest
steps:
- uses: actions/checkout@v1
- name: Install gpg
run: brew install gnupg
- name: Switch XCode Version
run: sudo xcode-select -s /Applications/Xcode_11.3.app
- name: Setup provisioning profile
run: |
chmod +x ./.github/secrets/secrets.sh
./.github/secrets/secrets.sh
env:
IOS_PROFILE_KEY: ${{ secrets.ios_profile_key }}
- name: Install Cocoapods
run: gem install cocoapods
- name: Install pod dependencies
run: |
pod install
shell: bash
- name: Build archive
run: |
xcodebuild archive -workspace abc.xcworkspace -scheme abcStaging -archivePath abc.xcarchive
- name: Export Archive
run: |
xcodebuild -exportArchive -archivePath abc.xcarchive -exportPath abc.ipa -exportOptionsPlist ./abc/ExportOptions.plist -allowProvisioningUpdates
下面是shell脚本
#!/bin/sh
gpg --quiet --batch --yes --decrypt --passphrase="xxxx" --output ./.github/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxx.mobileprovision ./.github/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxx.mobileprovision.gpg
gpg --quiet --batch --yes --decrypt --passphrase="xxxx" --output ./.github/secrets/abc_Certificates.p12 ./.github/secrets/abc_Certificates.p12.gpg
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp ./.github/secrets/xxxxx-xxxx-xxxx-xxxx-xxxxxxxx.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/xxxxx-xxxx-xxxx-xxxx-xxxxxxxx.mobileprovision
security create-keychain -p "" build.keychain
security import ./.github/secrets/abc_Certificates.p12 -t agg -k ~/Library/Keychains/build.keychain -P "xxxx" -A
security list-keychains -s ~/Library/Keychains/build.keychain
security default-keychain -s ~/Library/Keychains/build.keychain
security unlock-keychain -p "" ~/Library/Keychains/build.keychain
security set-keychain-settings -lut 1500 ~/Library/Keychains/build.keychain
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" ~/Library/Keychains/build.keychain
如何为登台(非开发或非生产环境)创建证书、资源调配配置文件?
请告知,我如何解决上述分期付款/质量保证问题
谢谢我得到了同样的错误,并且能够找到解决方案。可能会出现很多问题,因此我将补充几点,以帮助您纠正问题:
for PROVISION in `ls ./*.mobileprovision`
do
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ./$PROVISION)`
cp "./$PROVISION" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision"
done
用于'ls./*.mobileprovision中的规定`
做
UUID=`/usr/libexec/PlistBuddy-c'Print:UUID'/dev/stdin您找到解决方案了吗?我也面临着同样的问题。如果您发现了任何解决方案,请与我们分享,谢谢。我已经解决了这个问题,并在下面发布了我的答案。希望将来的任何人都会觉得它有用:)
error: No profiles for 'com.abc.Staging' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.abc.Staging'
for PROVISION in `ls ./*.mobileprovision`
do
UUID=`/usr/libexec/PlistBuddy -c 'Print :UUID' /dev/stdin <<< $(security cms -D -i ./$PROVISION)`
cp "./$PROVISION" "$HOME/Library/MobileDevice/Provisioning Profiles/$UUID.mobileprovision"
done