bump_version 0.1.0
bump_version: ^0.1.0 copied to clipboard
A CLI tool to auto-bump the version and build number in a Flutter/Dart pubspec.yaml before each release build.
bump_yaml_version #
Auto-bump the version: field in your Flutter/Dart pubspec.yaml before
every release build — no more manually editing x.y.z+N by hand.
Install (global CLI) #
dart pub global activate bump_yaml_version
Usage #
Run from your project root (where pubspec.yaml lives):
# bump build number only: 1.2.3+7 -> 1.2.3+8
bump_yaml_version
# bump patch: 1.2.3+7 -> 1.2.4+8
bump_yaml_version patch
# bump minor: 1.2.3+7 -> 1.3.0+8
bump_yaml_version minor
# bump major: 1.2.3+7 -> 2.0.0+8
bump_yaml_version major
# point at a different pubspec.yaml
bump_yaml_version patch -f path/to/pubspec.yaml
Then build as usual:
flutter build appbundle
Why not touch android/app/build.gradle? #
Standard Flutter projects read versionCode/versionName directly from
pubspec.yaml via flutter.versionCode / flutter.versionName in
android/app/build.gradle. Bumping pubspec.yaml is enough unless your
project hardcodes those values instead.
As a dev_dependency + script #
dev_dependencies:
bump_yaml_version: ^0.1.0
dart run bump_yaml_version patch