4

I'm setting up a CI pipeline for an iOS application using GitHub Actions.

When executing a build command:

xcodebuild \
  -workspace xxx.xcworkspace \
  -scheme SecureImage \
  clean build | xcpretty

It gets stuck on Running script '[CP] Embed Pods Frameworks' until it times out based on the 2 hour time out I've set.

▸ Compiling Main.storyboard
▸ Compiling Albums.storyboard
▸ Processing Info.plist
▸ Running script '[CP] Embed Pods Frameworks'
Error: The operation was canceled.

After a lot of googling, I suspect the only thing that could be, is something to do with the keychain but I can't see what. This is my script for adding the certificates after decrypting them:

mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles

cp ./.github/secrets/Provisioning.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/Provisioning.mobileprovision

security create-keychain -p "" ~/Library/Keychains/build.keychain
security import ./.github/secrets/Certificates.p12 -t agg -k ~/Library/Keychains/build.keychain -P "" -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-key-partition-list -S apple-tool:,apple:,codesign: -s -k "" ~/Library/Keychains/build.keychain

I'm completely stuck.

0

2 Answers 2

2

I was facing this issue while building the ios app on Github actions as well, however, I was using Fastlane to build the app on CI.

There are a few things that fixed the issue:

  1. Disable parallel builds by adding the following to Podfile: install! 'cocoapods', :disable_input_output_paths => true

  2. Add setup_ci(force: true) before calling match

For reference, this is the entire code for the lane used to build the app:

  lane :beta do
    xcode_select "/Applications/Xcode_15.4.app"
    setup_ci(force: true)    
    match(type: "appstore", readonly: is_ci)
    build_app(
      workspace: "App.xcworkspace",
      scheme: "App",
      xcargs: "CODE_SIGN_STYLE=Manual -allowProvisioningUpdates",
      destination: "generic/platform=iOS",
      export_method: "app-store",
      export_options: "ExportOptions.plist",
      )
    upload_to_testflight
  end

Create the ExportOptions.plist file, make sure it is filled correctly:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>teamID</key>
    <string>TEAM_ID</string>
    <key>method</key>
    <string>app-store</string> <!-- This can also be 'ad-hoc', 'enterprise', or 'development' if needed -->
    <key>provisioningProfiles</key>
    <dict>
        <key>com.app</key>
        <string>match AppStore com.app</string>
    </dict>
    <key>signingStyle</key>
    <string>manual</string>
    <key>destination</key>
    <string>export</string>
    <key>compileBitcode</key>
    <true/> <!-- Set to true if you need bitcode; otherwise, false -->
</dict>
</plist>
Sign up to request clarification or add additional context in comments.

Comments

-1

i think you need to install pods before building

- name: Install CocoaPod Dependencies
      run: pod install

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.