I've Created below YAML for iOS Build Pipeline for Monorepo environment and Reactive as frontend. Pipeline is taking so much of time (Nearly 57 minutes) in Azure Devops, specially build step taking 39-43 minutes. Please help to reduce the pipeline build time.
trigger:
- none
resources:
- repo: self
pool:
vmImage: 'macos-latest'
variables:
- group: resfebervariables #Variable name where certificate password has been saved.
steps:
- checkout: self
persistCredentials: true
clean: true
- task: NodeTool@0
displayName: 'Install Node'
inputs:
versionSpec: '18.0.0' # you can use your desired version here
- script: yarn install
displayName: Install Dependencies
- script: |
# Disable autocommit on version bump
yarn config set version-sign-git-tag false
yarn config set version-git-tag false
yarn config set version-commit-hooks false
# Checkout branch where the build is triggered
git checkout $(Build.SourceBranchName)
# Extract existing version of package.json
oldVer=$(jq -r ".version" package.json)
# Bump version
yarn version --patch
# Add bumped version to staging
git add *
# Extract new version of package.json
newVer=$(jq -r ".version" package.json)
# Set environment variables
echo "##vso[task.setvariable variable=OLD_VERSION]$oldVer"
echo "##vso[task.setvariable variable=NEW_VERSION]$newVer"
displayName: 'Bump version and set variables'
- task: ios-bundle-version@1
displayName: 'Bump iOS version'
inputs:
sourcePath: 'packages/res-feber-mobile/ios/resfebermobile/Info.plist'
versionCodeOption: 'buildid'
versionCode: '$(Build.BuildId)'
versionName: '$(NEW_VERSION)'
printFile: false
- task: InstallAppleCertificate@2
displayName: Install Apple Certificate
inputs:
certSecureFile: 'resfeber.p12'
certPwd: '$(p12password)'
keychain: 'temp'
deleteCert: true
- task: InstallAppleProvisioningProfile@1
displayName: 'Install Apple Provisioning Profile'
inputs:
provisioningProfileLocation: 'secureFiles'
provProfileSecureFile: 'resfeber_Enterprise_QA.mobileprovision'
removeProfile: true
- task: CocoaPods@0
displayName: 'Install CocoaPods'
inputs:
workingDirectory: '/Users/runner/work/1/s/packages/res-feber-mobile/ios'
- task: Xcode@5
displayName: 'Build IPA'
inputs:
actions: 'build'
configuration: 'Qa'
sdk: 'iphoneos'
scheme: 'resfebermobileQa'
xcWorkspacePath: '/Users/runner/work/1/s/packages/res-feber-mobile/ios/resfebermobile.xcworkspace'
packageApp: true
exportPath: 'output/$(SDK)/$(Configuration)'
exportMethod: 'enterprise'
signingOption: 'manual'
signingIdentity: '$(APPLE_CERTIFICATE_SIGNING_IDENTITY)'
provisioningProfileUuid: '$(APPLE_PROV_PROFILE_UUID)'
- task: CopyFiles@2
displayName: 'Copy Files to: $(build.artifactstagingdirectory)'
inputs:
SourceFolder: '$(system.defaultworkingdirectory)'
Contents: |
**/*.ipa
**/*.dSYM/**
TargetFolder: '$(build.artifactstagingdirectory)'
overWrite: true
cleanTargetFolder: true
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: iOSBuild'
inputs:
ArtifactName: iOSBuild
help needed to reduce the build time. yarn install function can be used script can be commented. Pipeline steps and timing