How to commit updated build number in Info.plist to my repo

Hi, my project’s build number is updated after “Set Xcode Project Build Number” step
I’m trying to commit and push incremented build number to my repository
My script:
git branch
git add $BITRISE_SOURCE_DIR/Sources/Classes/Applications/Info.plist
git commit -m “App build version has been updated”
git push origin develop

But build fails with error:

  • git branch
  • (HEAD detached at 6544491)
  • git add /Users/vagrant/git/Sources/Classes/Applications/Info.plist
    fatal: pathspec ‘/Users/vagrant/git/Sources/Classes/Applications/Info.plist’ did not match any files
    | |
    ±–±--------------------------------------------------------------±---------+
    | x | script@1.1.6 (exit code: 128) | 3.01 sec |
    ±–±--------------------------------------------------------------±---------+

Could you please help me or show an example how to do such commit?

Hi @max.kryuchkov111! Is there a reason you want to commit the updated number into your repository? :thinking:

Hi, @bitce
I want to increment app’s build number automatically after each Bitrise build

Hi @max.kryuchkov111, I understand, but that’s exactly what the "Set Xcode Project Build Number” step is doing. Assuming that you will be deploying your application from Bitrise’s Virtual Machine’s, you don’t actually have to modify the value of this number in your repo at all, you just have to make sure it gets incremented properly on the virtual machine :slight_smile:

In fact, if you do commit new numbers to your repository, you don’t really need to step to automatically increment it for you.

I have app with build number: 3
Then "Set Xcode Project Build Number” step is succeeded:

INFO[07:42:26] * [OK] Step dependency (xcode) installed, available.
(i) Provided Info.plist path: /Users/vagrant/git/Scanner/Info.plist
(i) Version number: 1.1.0
(i) Build number offset: 3
(i) Build number: 17

But when I install app (using Bitrise link) it shows me the old build number: 3

30

Can you send me an URL for this build?

https://app.bitrise.io/artifact/32159967/p/11b7623a66ff9f15e241b681b7cfd559

Sorry, I mean to say for the build itself. This is a link to the artifact, I would want to see the logs that produced this artifact :slight_smile:

Here is build logs
https://file.io/rygua0

I’m getting a 404 not found on this :frowning: can you please paste the URL from the builds page here? That allows us to download the logs and see metadata about the build.

Sure
https://app.bitrise.io/build/51ab1262b97155c0#?tab=log

Thanks!

So, the problem here is that you update your build number after the Xcode Archive step. You built your app before the number was updated.

You should make sure the Set Xcode Project Build Number step is before the Xcode Archive step :slight_smile:

I’ve got it, thank you very much

1 Like

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