Automaticly updates a project version and build number in:
- package.json
- iOS
- Android
Install global package by:
npm i -g react-native-semver-update
- Write commmand in terminal and press [enter]:
rnsemup
- Choose what do you need from menu.
Build Number:
rnsemup -b
Project Version:
rnsemup -u <unit>
where unit
is:
-
major
1.2.3 → 2.0.0 -
minor
1.2.3 → 1.3.0 -
patch
1.2.3 → 1.2.4
For example:
rnsemup -b -u minor
- Increase build number
- Increase minor in project version
- Set patch is 0
- It find files in current directory by defined paths array (see paths.js)
PACKAGE: resolve(CURRENT_DIRECTORY_PATH, './package.json'),
ANDROID: resolve(CURRENT_DIRECTORY_PATH, './android/app/build.gradle'),
IOS: resolve(CURRENT_DIRECTORY_PATH, './ios/<YOUR PROJECT NAME FROM app.json>.xcodeproj/project.pbxproj'),
- Find & replace versions by regular expressions (see searchPatterns.js)
Android
- versionName
- versionCode
iOS
- MARKETING_VERSION
- CURRENT_PROJECT_VERSION
- Display previous and new versions in terminal
- react-native 0.60+
- I just tired to change build number by manual. Maybe you too...
- https://semver.org/