Subhan
Subhan

Reputation: 1634

Azure Fastlane auto increment build number

I've been trying to auto-increment the build number of my tvos app through the app release step in my azure pipeline.

I followed this documentation to create this step.

- task: AppStoreRelease@1
inputs:
  serviceEndpoint: 'Test Connection to App Store'
  appIdentifier: ${{ parameters.appIdentifier }}
  appType: 'tvOS'
  ipaPath: '$(Build.ArtifactStagingDirectory)/${{ parameters.defaultArtifacts }}/build/*.ipa'
  releaseTrack: 'TestFlight'
  shouldSkipWaitingForProcessing: true
  shouldSkipSubmission: true
  fastlaneArguments: '--app_platform=appletvos --increment_build_number'
displayName: App Store Release

I want to use this fastlane argument to increment my build number, but I'm not sure how I would do that in the yml format. I've tried to add it as an additional argument like:

fastlaneArguments: '--app_platform=appletvos --increment_build_number'

But, It throws an invalid argument error. Looking for anyone having experience with such a scenario who would like to share the wisdom.

Upvotes: 3

Views: 1397

Answers (2)

Subhan
Subhan

Reputation: 1634

For anyone struggling with this in the future, I managed to update the build number by adding the following step in the pipeline before creating an archive or before Xcode build task.

- script: fastlane run increment_build_number build_number:$(Build.BuildId) xcodeproj:Path_TO_PROJECT/app.xcodeproj
displayName: Update Build Number

Note: parameter xcodeproj is optional. if *.xcodeproj sub directory is located in your project root, you can ignore it.

Upvotes: 3

AnnawanDev
AnnawanDev

Reputation: 435

I took a very similar approach as @Subhan Ahmed

If you're not wanting to do it through Fastlane for whatever reason, here's a script that will work,

- script: /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $(Build.BuildId)" "$(Build.SourcesDirectory)/Info.plist"

Upvotes: 1

Related Questions