Releases
This section will cover whats required to create a release branch and properly update the app verions for the next release. The release process is closely tied to our branching strategy in git itself.
We use Trunk Based Development with a release strategy called Branch for Release.
Those links outline and go into depth the why, how and the advantages of TBD but as a summary there are a few rules that arent to be broken:
- Trunk (main) is the source of truth - all code is merged to main
- Avoid long-lived feature branches and branch stacking
- Utilise feature flags to enrsure WIP code paths cannot be exposed to the customer
Creating a Release
Since the introductiuon of the Native apps there are 4 steps in creating a new release for the apps
- Create release branches
- Update
.gitmodules
- Update app version
- CI scheduled pipeline
- update slack
1. Create release branches
Once app brands adopt the native shell, we will align branch / version numbers across the repos
Release branches need to be created in each app repo they follow the pattern release/MAJOR.MINOR.PATCH
for example, lets create a new app release, currently because not all brands are on the native shell version of the app the release branches across the 3 repos will be out of sync. Lets create the release branches for the next native release 9.10.0 and react-native 8.90.0
Repo | branch |
---|---|
react-native | release/8.90.0 |
native iOS | release/9.10.0 |
native Android | release/9.10.0 |
2. Update .gitmodules
Since the react-native repo has the submodules for native, we need to update .gitmodules
file on the react-native release branch.
Using the example above of native release 9.10.0 and react-native 8.90.0. On the react-native repo, create an MR targeting the release/8.90.0
branch which edits the .gitmodules
and updates the branch variable
[submodule "android-rebuild"]
path = android-rebuild
url = ../../native/android.git
branch = release/9.10.0
[submodule "ios-rebuild"]
path = ios-rebuild
url = ../../native/ios.git
branch = release/9.10.0
3. Update App Versions
Once app brands adopt the native shell, we will align branch / version numbers across the repos
Across all 3 repos the version set in main
is always for the next version to be released. So when creating the release branch no changes are required to the version on the release branch but once the release branch is cut then main
needs to be updated for the next release
Using the example above native release 9.10.0 and react-native 8.90.0. Since we have created the release branches already the version number main
needs to be updated to 9.20.0
and 8.91.0
This needs to be done in a couple of spots and MR's created to main.
for react native:
- package.json
- android/app/build.gradle
- ios/ReactNative.xcodeproj/project.pbxproj
https://git.neds.sh/technology/code/ui/react-native/-/merge_requests/15054/diffs
iOS:
- Build Settings/Project/Base/mobile.xcconfig
https://git.neds.sh/technology/code/native/ios/-/merge_requests/1478/diffs
Android:
- app/build.gradle.kts
https://git.neds.sh/technology/code/native/android/-/merge_requests/1226/diffs
Note: For both updating .gitmodules
branch references and app versions, we also have scripts/versionUpdate.js
within React Native that can be used to perform this task across all required repositories.
4. CI scheduled pipeline
Create a new schedule and remove the old schedule (if not removed alredy). the react-native repo is responsible for creating all the builds native or react-native.
Go to Scheduled Pipelines and take ownership of the old release pipelines (Build & Build and deploy). Once you have taken ownership of the pipelines you are ablle to edit them
change the target branch to the react-native release branch, update the title and leave all other information the same. The pipeline may have been deactivated, if thats the case: activate it.
Play the pipeline, if you need builds now, or wait for the schedule to do it.
Message #native-ios-android-all-teams that you have created the new release branches.
Hey all, I have created react-native branch release/8.90.0 which maps the native submodule to the newly created native branches release/9.10.0 to prepare for the release
- if you have react-native changes target your cherry-pick to release/8.90.0
- if you have native changes target your cherry pick to release/9.10.0