Reputation: 3661
Synopsis:
Automate deployment, of an Ionic app, to the Apple App Store.
Environments:
Dev machine (Macbook) running:
Azure DevOps Build Pipe steps:
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:
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.
Jan 10, 2019 - changed scheme from '' to 'MyApp' to resolve build issue, moving on to archive..
References:
Upvotes: 1
Views: 1385
Reputation: 3661
My immediate issue of having a failed build was resolved by setting the scheme variable correctly to 'MyApp'. I will continue to update this question (and my answer) while working to the end goal of having a working Azure DevOps build pipe that deploys MyApp to the Apple App Store into TestFlight. Outstanding things are signing, archiving and deploying.
Final Xcode build (and archive) step yaml:
variables:
configuration: 'Release'
scheme: 'MyApp'
steps:
- task: Xcode@5
displayName: 'Xcode build archive'
inputs:
actions: 'build archive'
configuration: '$(configuration)'
xcWorkspacePath: '**/MyApp.xcodeproj'
scheme: '$(scheme)'
xcodeVersion: 10
Upvotes: 1