Действия GitHub IOS xcode QA / Подготовка и выпуск сертификатов и профиля обеспечения - PullRequest
0 голосов
/ 18 апреля 2020

Я использую действия GitHub для IOS, используя xcode 11.3. Я могу построить, экспортировать архив и pu sh в центр приложений для среды разработки. Тем не менее, я получаю сообщение об ошибке со средой промежуточного уровня / контроля качества.

Если я предоставляю те же сертификаты и файлы обеспечения, которые я использовал для среды разработки при подготовке / QA, я получаю сообщение об ошибке при экспорте архива (сборка прошла успешно): -

#Export Archives
##[error]Process completed with exit code 70.
Run xcodebuild -exportArchive -archivePath abc.xcarchive -exportPath abc.ipa -exportOptionsPlist ./abc/ExportOptions.plist          
2020-04-16 15:57:11.154 xcodebuild[7404:37990] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/abcStaging_2020-04-16_15-57-11.153.xcdistributionlogs'.
error: exportArchive: No profiles for 'com.abc.Staging' were found
** EXPORT FAILED **

Error Domain=IDEProfileLocatorErrorDomain Code=1 "No profiles for 'com.abc.Staging' were found" UserInfo={IDEDistributionIssueSeverity=3, NSLocalizedDescription=No profiles for 'com.abc.Staging' were found, NSLocalizedRecoverySuggestion=Xcode couldn't find any iOS Ad Hoc provisioning profiles matching 'com.abc.Staging'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.}

если я создаю новый сертификат (дистрибутив Apple) и файл обеспечения (Adho c дистрибутив) в учетной записи разработчика Apple. Экспортировал файлы и конвертировал файлы, затем загрузил .p12.gpg и mobileprovision.gpg в действия GitHub, я получаю сообщение об ошибке во время сборки: -

#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          


Ниже приведен сценарий оболочки

#!/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

Как создавать сертификаты, предоставляя профили для подготовка (непроизводственная или непроизводственная среда)? Пожалуйста, посоветуйте, как мне решить проблему с использованием staging / qa, как указано выше?

Спасибо

...