Incrementing Cloud Builds bundle number

I did something similar here: Is it possible to update Version and Bundle number automatically?

That link above is just for local builds, use this code for cloud builds: Is it possible to update Version and Bundle number automatically?

Just remember to change ‘NAMEOFAPPGOESHERE’ part to your app name (without spaces).