ios – Error on codemagic publishing IPA to testflight

0
106

[ad_1]

i having the follow error:

Command: app-store-connect publish –path /Users/builder/clone/build/ios/ipa/zimexahse.ipa –key-id ‘$APP_STORE_CONNECT_KEY_IDENTIFIER’ –issuer-id ‘$APP_STORE_CONNECT_ISSUER_ID’ –private-key @env:APP_STORE_CONNECT_PUBLISHER_PRIVATE_KEY

error: argument –private-key: Provided value in environment variable “APP_STORE_CONNECT_PUBLISHER_PRIVATE_KEY” is not valid. Provided value is not a valid PEM encoded private key

codemagic.yaml

 workflows:
  ios-workflow-id:
    name: iOS Workflow
    max_build_duration: 120
    instance_type: mac_mini_m1
    environment:
      node: 14.17.6
      npm: latest
      ios_signing:
        distribution_type: development # or: ad_hoc | development | enterprise
        bundle_identifier: ...
      groups:
        - appstore_credentials
      vars:
        APP_ID: ...
        BUNDLE_ID: "..."
        XCODE_WORKSPACE: "....xcworkspace"
        XCODE_SCHEME: "..."
    scripts:
      - name: install node dependencies
        script: |
          yarn install
      #    npm install --legacy-peer-deps
      - name: Set Info.plist values
        script: |
          PLIST=$CM_BUILD_DIR/$XCODE_SCHEME/Info.plist
          PLIST_BUDDY=/usr/libexec/PlistBuddy
          $PLIST_BUDDY -c "Add :ITSAppUsesNonExemptEncryption bool false" $PLIST
      - name: Install CocoaPods dependencies
        script: |
          cd ios && pod install
      - name: Set up provisioning profiles settings on Xcode project
        script: xcode-project use-profiles
      - name: Increment build number
        script: |
          cd $CM_BUILD_DIR/ios
          LATEST_BUILD_NUMBER=$(app-store-connect get-latest-app-store-build-number "$APP_ID")
          agvtool new-version -all $(($LATEST_BUILD_NUMBER + 1))
      - name: Build ipa for distribution
        script: |
          xcode-project build-ipa \
            --workspace "$CM_BUILD_DIR/ios/$XCODE_WORKSPACE" \
            --scheme "$XCODE_SCHEME" \
            --archive-flags="-destination 'generic/platform=iOS'"
    artifacts:
      - build/ios/ipa/*.ipa
      - /tmp/xcodebuild_logs/*.log
      - $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.app
      - $HOME/Library/Developer/Xcode/DerivedData/**/Build/**/*.dSYM
    publishing:
      app_store_connect:
        api_key: $APP_STORE_CONNECT_PRIVATE_KEY
        key_id: $APP_STORE_CONNECT_KEY_IDENTIFIER
        issuer_id: $APP_STORE_CONNECT_ISSUER_ID
        submit_to_testflight: true
        beta_groups:
          - ...
        submit_to_app_store: false

the api key was already configured in codemagic

[ad_2]