Build number options besides $BITRISE_BUILD_NUMBER

ios
#1

Hi, so currently there are 5 workflows in my project:

  1. Branch => triggered by a push to any branch
  2. Pull-req => trigger by a creation / update of pull-req
  3. Master => triggered by a merge to master
  4. Beta => Manually triggered to push to Testflight for beta testing
  5. Release => Manually triggered to push for distribution using a tag “release-vx.x.x”

For the Beta and Release workflow, I added the Set Xcode Project Build Number step to set the version and build number. I use the default value for the build number, which is $BITRISE_BUILD_NUMBER. But the problem is, this number is used in all workflows. So if I ran these workflows:

  • Branch #1
  • Branch #2
  • Branch #3
  • Pull-req #4
  • Master #5
  • Branch #6
  • Branch #7
  • Branch #8
  • Branch #9
  • Branch #10
  • Pull-req #11
  • Master #12
  • Beta #13
  • Branch #14
  • Branch #15
  • Pull-req #16
  • Master #17
  • Release #18

The CFBundleVersion of the Testflight version will be 13, which means the full version will be 1.0 (13). And the Release CFBundleVersion will be 18. But I want it to be 1 and 2 because they are the first and second build in the App Store, respectively. How do I increment the CFBundleVersion only from those two workflows?

Thanks.

0 Likes

Can you suggest to me a good iOS release train workflow?
#2

Anybody can give me any suggestion? bump

0 Likes

#3

Hello,

If you haven’t already, please review “Build numbering and app versioning”

As you noted, $BITRISE_BUILD_NUMBER is updated for each build regardless of the workflow used. If you want a counter that you control, you will need to save the value outside the build after you increment it and pull it when you want to use the value.

You might consider using generic file storage.

0 Likes

#4

I see. Okay I will try looking it up. Thanks.

0 Likes