Build number options besides $BITRISE_BUILD_NUMBER

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.

Anybody can give me any suggestion? bump

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.

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

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.