ios-templates icon indicating copy to clipboard operation
ios-templates copied to clipboard

Set the run number/build number of CI/CD tools as the app's build number

Open phongvhd93 opened this issue 2 years ago • 3 comments

Issue

CI/CD tools like Bitrise, GitHubAction, and Codemagic provide the build number so we can use that for the build number of the application. The benefits of that are:

  • It is easier to track the commit of a version.
  • Avoid duplicate build numbers when rebuilding the same commit (after registering a new device, we must re-deploy the app).
  • CI machines don't have to clone the whole project history to get the correct number of commits, reducing the overall build time and the cost of running CI/CD.

Solution

  • Use $BITRISE_BUILD_NUMBER if CI/CD runs on Bitrise or $GITHUB_RUN_NUMBER in the case of GitHubAction as the app's build number.
  • Update the private lane bump_build to take the build number variable from Bitrise or GitHubAction.
  • Update the property release_tag in VersioningManager to take the build number instead of the @fastlane.number_of_commits.

Who Benefits?

iOS Chapter and iOS developers

What next?

  • [x] Create stories for updating Bitrise template, GitHubAction template and FastLane template.
  • [ ] Implement and create pull requests. 🙌

phongvhd93 avatar Jul 13 '22 02:07 phongvhd93

A good thing we learned from Codemagic, right 🤟

markgravity avatar Jul 15 '22 04:07 markgravity

@phongvhd93 you can create task for this RFC 🙏

markgravity avatar Aug 02 '22 04:08 markgravity

This is a good story, we can reuse this as the story for the task.

blyscuit avatar Oct 09 '23 02:10 blyscuit