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

ios
#1

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?

0 Likes

#2

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

0 Likes

#3

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

0 Likes

#4

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.

0 Likes

#5

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

0 Likes

#6

Can you send me an URL for this build?

0 Likes

#7

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

0 Likes

#8

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:

0 Likes

#9

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

0 Likes

#10

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.

0 Likes

#11

Sure

0 Likes

#12

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:

0 Likes

#13

I’ve got it, thank you very much

1 Like

closed #14

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

0 Likes