xcodebuild \
  -exportArchive -verbose \
  -sdk iphoneos \
  -archivePath XYZProject.xcarchive \
  -exportOptionsPlist $RUNNER_TEMP/ExportOptions.plist \
  -exportPath "" \
  -authenticationKeyIssuerID ${{ secrets.APPSTORE_ISSUER_ID }} \
  -authenticationKeyID ${{ secrets.APPSTORE_API_KEY_ID }} \
  -authenticationKeyPath $RUNNER_TEMP/AuthKey_${{ secrets.APPSTORE_API_KEY_ID }}.p8
Uploading build to appstore connect fails with the error:
error: exportArchive: Failed to log in.
Error Domain=IDEDistributionErrorDomain Code=10 "Failed to log in." UserInfo={IDEDistributionErrorsAccountIssues=(
), NSLocalizedDescription=Failed to log in., NSLocalizedRecoverySuggestion=App Store Connect access for “*******” is required. Ensure that your Apple ID account usernames and passwords are correct in the Accounts preference pane.}
If I login to Xcode with the appleId, this just works fine but that is why I use authenticationKeyID, authenticationKeyIssuerID, authenticationKeyPath to authenticate.
ExportOptions.plist
<?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>destination</key>
    <string>upload</string>
    <key>manageAppVersionAndBuildNumber</key>
    <true/>
    <key>method</key>
    <string>app-store</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.my.bundle.id</key>
        <string>AppName - PROD</string>
    </dict>
    <key>signingCertificate</key>
    <string>Apple Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>teamID</string>
    <key>uploadSymbols</key>
    <true/>
</dict>
</plist>
Any idea what could be the issue here?
Please note the key has developer role access to app store connect.
Edit : Using an admin key also doesn't solve the issue
 
     
    
