Synopsis:
Automate deployment, of an Ionic app, to the Apple App Store.
Environments:
Dev machine (Macbook) running:
- Node 10.14.1
- Cordova 8.1.1
- Ionic 4.5.0
- Xcode 10.1
Azure DevOps Build Pipe steps:
- npm install
- ionic command
- install apple certificate (disabled)
- install apple provisioning profile (disabled)
- xcode build >> error here, now resolved -- see my answer below..
- publish
yaml:
npm install
steps:
- task: Npm@1
displayName: 'npm install'
inputs:
verbose: false
ionic command
variables:
IonicVersion: '4.5.0'
CordovaVersion: '8.1.1'
steps:
- task: ms-vsclient.cordova-extension.ioniccommandtask.IonicCommand@1
displayName: 'Ionic Command cordova build ios'
inputs:
ionicCommand: 'cordova build ios'
ionicArgs: '--prod --release -- --buildFlag=\"-UseModernBuildSystem=0\"'
ionicVersion: '$(IonicVersion)'
cordovaVersion: '$(CordovaVersion)'
xcode build
variables:
scheme: ''
steps:
- task: Xcode@5
displayName: 'Xcode build'
inputs:
xcWorkspacePath: '**/MyApp.xcodeproj'
scheme: '$(scheme)'
xcodeVersion: 10
destinationPlatformOption: iOS
destinationSimulators: 'iPhone 6'
publish
steps:
- task: ms-vsclient.app-store.app-store-release.AppStoreRelease@1
displayName: 'Publish to the App Store TestFlight track'
inputs:
serviceEndpoint: 'ACTRA Apple Dev Program'
ipaPath: '$(build.artifactstagingdirectory)/**/*.ipa'
What is working... I can build and deploy from my dev environment, with steps:
- git clone my_app_repo
- ionic cordova build ios --prod --release -- --buildFlag=\"-UseModernBuildSystem=0\"
- open platforms/ios/MyApp.xcodeproj
- set active scheme to Generic iOS Device
- select Legacy Build System via File > Project Settings...
- uncheck and re-check Automatically manage signing
- select Apple dev Team (Provisioning Profile - from drop-down list)
- build & deploy via Product > Archive > Distribute App
Issue/trouble:
During build step of Azure DevOps pipe, the following error occurs:
/Users/vsts/agent/2.144.0/work/1/s/platforms/ios/MyApp/Plugins/ionic-plugin-deeplinks/IonicDeeplinkPlugin.h:1:9: 'Cordova/CDVPlugin.h' file not found
I have dropped a powershell script after the ionic cmd step to check the folder contents, and the file CDVPlugin.h exists in the folder: /Users/vsts/agent/2.144.0/work/1/s/platforms/ios/CordovaLib/Classes/Public
Maybe the question is about resolving paths within the agent or xcode during build. It seems xcode is unable to resolve path.
Updates
Jan 10, 2019 - changed scheme from '' to 'MyApp' to resolve build issue, moving on to archive..
References: