react-native-version extend the behaviour of npm version. react-native-version docs
The fork adds:
--never-increment-prerelease detect prerelease version and use --never-increment-build
--version-build to set version to build number
npm i github:denis-kungurov/react-native-version#<commit-hash> --save-devHook into the "version" or "postversion" npm script in your app's package.json:
{
"name": "AwesomeProject",
"scripts": {
+ "postversion": "react-native-version --never-increment-prerelease -t android && react-native-version --version-build -t ios"
}
}Just run npm version <newversion>.
react-native-version will then update your android/ and ios/ code. Depending on the script and options you choose, it can also automatically amend the version bump commit and update the Git tag created by npm version. This method should be useful in most cases. If you need more control, take a look at the CLI and options below.