nimblehq / ios-templates

Our optimized iOS templates used in our projects
https://nimblehq.co
MIT License
89 stars 12 forks source link

CI/CD - Use build number provided by CI/CD services #316

Open phongvhd93 opened 2 years ago

phongvhd93 commented 2 years ago

Why

CI/CD tools like Bitrise, GitHubAction, and Codemagic provide the build number so we can use that for the build number of the application. We will update our templates for Bitrise and GitHubAction to get the following benefit:

Who Benefits?

@nimblehq/ios-chapter

olivierobert commented 1 year ago

@ducbm051291 This was assigned to @edgarss so for now it is still need to be assigned to him. It is part of his personal tasks to complete 🙏

blyscuit commented 1 year ago

To improve on @phongvhd93 AC. I think this is referring to https://devcenter.bitrise.io/en/builds/build-numbering-and-app-versioning.html and GITHUB_RUN_NUMBER from https://docs.github.com/en/actions/learn-github-actions/variables. Not sure about other CI providers. Just so that we are aligned 🙇 .

Thieurom commented 1 year ago

This is great and very convenient 🙏

However, we should be careful in case the project switches to another CI service in the middle of development.

Let's say that project has been using GitHub Action to deploy builds to TestFlight up to 1.2.0(250) using GITHUB_RUN_NUMBER. Now they have switched to Bitrise, and the very first build on Bitrise that uses BITRISE_BUILD_NUMBER would be 1.2.0(1). This is not what we expected. Furthermore, Apple might reject the build or silently increment the build, which is out of our control and confuse us.

As I see, Bitrise allows us to offset the build number. GitHub Action is not specifically for iOS, so we have to do that manually. And it seems more complicated than it should be (https://github.com/orgs/community/discussions/25386).

In either case, we should bear this in mind. We might note this on the Infrastructure of the Wiki 🙏