bitrise-steplib / steps-set-xcode-build-number

Sets the Build Number to the specified value in the Info.plist file for the next build
MIT License
7 stars 11 forks source link

Can't offset the build from another build step #20

Closed havebeenfitz closed 2 years ago

havebeenfitz commented 4 years ago

Hello, thanks for the Bitrise!

I'm trying to increment my build number by one each time I trigger the "upload to testfilght" workflow. I can not use $BITRISE_BUILD_BUMBER so I use another build step to retrieve the current build number from plist then I use this value (XPI_BUILD) and set offset to 1. But offset doesn't seem to work in my case. Could you please guide me, what am I doing wrong?

https://github.com/tadija/bitrise-step-xcode-project-info this is the step I'm using to retrieve $XPI_BUILD

Screenshot 2020-03-08 at 21 10 29

What I get is "redundant binary upload" from testflight so I guess it didn't increment my build. Also, I have no git changes.

I also have an "operand expected" error

Screenshot 2020-03-08 at 21 38 29
bitce commented 4 years ago

Hi @havebeenfitz! Can you please share a bit more detail on what driven you to this use case? You mention you can use the $BITRISE_BUILD_BUMBER, can you explain why not?

havebeenfitz commented 4 years ago

Hello @bitce! I have multiple workflows and $BITRISE_BUILD_NUMBER will increment itself on each build, which is not what I want. I just need to keep the build number intact, because it affects some mechanics inside the app.

For example, I have build 1.0 (235), then I run 5 pull request workflows, then I merge into develop branch, my testflight workflow is triggered, and with $BITRISE_BUILD_NUMBER I would have 1.0 (240) in the testflight.

So my goal is to increment build number by 1 each time a specific workflow is triggered

bitce commented 4 years ago

Hi @havebeenfitz again!

The $BITRISE_BUILD_NUMBER increments with each build, but this does not mean your version number has to do the same.

So my goal is to increment build number by 1 each time a specific workflow is triggered

You can achieve this by only having the step in that workflow. See, for instance, I had my 240th build here, but chose to offset it with -5 to get 235. (Although it's an android example the behaviour is identical.)

Screenshot 2020-03-11 at 7 35 13
bitrise-coresteps-bot commented 2 years ago

Hello there, I'm a bot. On behalf of the community I thank you for opening this issue.

To help our human contributors focus on the most relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 90 days, so I marked it as stale.

The community would appreciate if you could check if the issue still persists. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me".

If no comment left within 21 days, this issue will be closed.

bitrise-coresteps-bot commented 2 years ago

I'll close this issue as it doesn't seem to be relevant anymore. We believe an old issue probably has a bunch of context that's no longer relevant, therefore, if the problem still persists, please open a new issue.