0

I have a IOS mobile application built using react native. I want to establish a CI/CD pipeline through Azure Pipelines. I know my app builds and works properly because I have manually archived it from Xcode and uploaded the ipa to App Center and was able to download and download and use it successfully on an ios device.

Here is my current yml script for Azure Pipelines. I have read the docs and watched tutorials but I must be missing something....

# jobs: 
# - job: MyApp
#   timeoutInMinutes: 240

trigger:
- staging

variables:
  - group: My-Variables

jobs: 
- job: Default
  timeoutInMinutes: 240

  pool:
    vmImage: 'macos-latest'

  steps:
    - checkout: self
      persistCredentials: true
      clean: true

    - script: npm install
      displayName: 'NPM Install'

    - task: InstallAppleCertificate@2
      displayName: Install Apple Certificate
      inputs:
        certSecureFile: 'Certificates.p12'
        certPwd: '$(AppleCertificatePassword)'
        keychain: 'temp'
        deleteCert: true

    - task: InstallAppleProvisioningProfile@1
      displayName: 'Install Apple Provisioning Profile'
      inputs:
        provisioningProfileLocation: 'secureFiles'
        provProfileSecureFile: 'myprofile.mobileprovision'
        removeProfile: true

    - task: CocoaPods@0
      displayName: 'Install CocoaPods'
      inputs:
        workingDirectory: 'ios'

    - task: Xcode@5
      displayName: 'Build IPA'
      inputs:
        actions: 'build'
        configuration: 'Release'
        sdk: 'iphoneos'
        xcWorkspacePath: 'ios/MyApp.xcworkspace'
        scheme: 'MyScheme'
        packageApp: true
        exportPath: 'output'
        signingOption: 'manual'
        signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
        provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'

    - task: CopyFiles@2
      displayName: 'Copy IPA'
      inputs:
        contents: '**/*.ipa'
        targetFolder: '$(build.artifactStagingDirectory)'
        overWrite: true
        flattenFolders: true

    - task: PublishBuildArtifacts@1
      displayName: 'Publish IPA to artifacts'
      inputs:
        PathtoPublish: '$(build.artifactStagingDirectory)'
        ArtifactName: 'ios'
        publishLocation: 'Container'

    - task: AppCenterDistribute@3
      displayName: 'Upload IPA to AppCenter'
      inputs:
        serverEndpoint: 'MyEndpoint'
        appSlug: 'My-Company/My-Mobile'
        appFile: 'output/MyMobile.ipa'
        releaseNotesOption: 'file'
        isMandatory: true
        destinationType: 'groups'
        distributionGroupId: 'myGroupID'
        isSilent: true

One concern is the ipa takes 2 hours to build. Thats fine though it still works.

The main error I keep getting is in the upload to app center section,

Azure Pipelines appcenterdistribute@3 error

I have tried changing the path but I get the same error.

Any advice would be much appreciated.

I tried running the job without the appcenterdistribute@3 task and it worked properly. So I know everything builds ok, its simply the app center part.

I made sure to connect azure devops with app center through the service connections in devops.

I'm at a loss.

Thanks for any help

0 Answers0