Introduction
Automating version numbers, build numbers, and release notes is a small investment that pays big dividends in Flutter mobile development. Manual version bumping is error-prone, slows CI/CD pipelines, and makes tracking releases difficult. This tutorial gives a focused, code-first approach to automate build numbers and generate release notes so your Flutter apps move from development to stores in a repeatable, auditable way.
Why Automate Versioning
Flutter uses the pubspec.yaml version field (format: MAJOR.MINOR.PATCH+BUILD) as the canonical app version. The build number (after +) is what Android treats as versionCode and iOS as CFBundleVersion. Automating ensures unique numeric build identifiers, consistent release names, and reduces human error when publishing to Google Play and App Store Connect. Automation is essential in team settings and for continuous delivery in mobile development.
Implementing Build Number Automation
A simple pattern is to keep semantic version (MAJOR.MINOR.PATCH) in git tags or CI variables and increment the build number automatically. Below is a minimal Dart script that increments the pubspec.yaml build number. Run it before building or as part of CI.
import 'dart:io';
final file = File('pubspec.yaml');
var txt = file.readAsStringSync();
final exp = RegExp(r"version:\s*(\d+\.\d+\.\d+)\+(\d+)");
final m = exp.firstMatch(txt);
if (m == null) throw 'version not found';
final base = m.group(1);
final build = int.parse(m.group(2)!)+1;
txt = txt.replaceFirst(exp, 'version: $base+$build');
file.writeAsStringSync(txt);
print('Updated version to $base+$build');Alternative approaches: derive build number from CI build ID or from the number of commits (git rev-list --count HEAD) to guarantee monotonic increases. In many CI providers you can set an environment variable (e.g., GITHUB_RUN_NUMBER) and pass it to flutter build with --build-number.
Example: flutter build apk --release --build-name=1.2.3 --build-number=$CI_BUILD_NUMBER
Generating Release Notes
Release notes should be generated from your git history or issue tracker. Two pragmatic methods:
Use commit messages following Conventional Commits and pipe git log to a script to extract features and fixes.
Use changelog generators (git-cliff, conventional-changelog) in CI to produce a markdown CHANGELOG.md or release body.
A simple git command to produce a concise list between tags:
git --no-pager log --pretty=format:'- %s (%h)' v1.2.2..HEAD
Use this output as the release body in GitHub Releases or to upload a release to the Play Store/App Store via their APIs. In CI you can save the generated notes to a file and attach it to the release artifact.
CI/CD Integration
Integrate the bump script and release-note generation into your CI pipeline in three steps:
Compute the next version/build number (from tags, commit count, or CI run number).
Run the Dart bump script or use flutter build flags to set build-number and build-name.
Generate release notes from git log and create a release through the provider (GitHub Actions: actions/create-release) or upload to stores using Fastlane.
Example flow on GitHub Actions:
Checkout
Run script to bump pubspec.yaml (or set env BUILD_NUMBER)
Commit version change or skip commit and pass --build-number
Run flutter test and flutter build
Produce release notes and call actions/create-release with the notes
Note: committing from CI requires a bot account token and careful branch policy handling. Many teams prefer not to commit to master from CI; they instead set build parameters at build time.
Runtime Version Access
Expose the version and build number inside the Flutter app for support and diagnostics. Use package_info_plus to show version on an about screen:
import 'package:package_info_plus/package_info_plus.dart';
Future<String> currentVersion() async {
final info = await PackageInfo.fromPlatform();
return '${info.version}+${info.buildNumber}';
}This helps QA and users reference exact builds when filing bugs.
Vibe Studio

Vibe Studio, powered by Steve’s advanced AI agents, is a revolutionary no-code, conversational platform that empowers users to quickly and efficiently create full-stack Flutter applications integrated seamlessly with Firebase backend services. Ideal for solo founders, startups, and agile engineering teams, Vibe Studio allows users to visually manage and deploy Flutter apps, greatly accelerating the development process. The intuitive conversational interface simplifies complex development tasks, making app creation accessible even for non-coders.
Conclusion
Automating versioning, build numbers, and release notes reduces friction and increases the reliability of Flutter mobile development pipelines. Choose a deterministic source for build numbers (CI run ID, commit count, or git tags), wire a small bump script or use flutter build flags, and generate release notes from git history or conventional changelog tools. Integrate these steps into CI so every build is traceable, reproducible, and ready for app stores.