Skip to content

ubxty/flutter_deploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_deploy

pub package License: MIT

A Dart CLI tool that saves Flutter developers from tedious release prep work.

Every app release involves the same repetitive steps:

  1. Open pubspec.yaml, find the version line, increment the build number
  2. Open ios/Runner/Info.plist, update CFBundleVersion
  3. Open ios/Runner.xcodeproj/project.pbxproj, update CURRENT_PROJECT_VERSION and MARKETING_VERSION
  4. Run flutter pub get

flutter_deploy handles all of that in one command, with smart defaults so you can press Enter through the entire flow.


Installation

Global (recommended — use from any project)

dart pub global activate flutter_deploy

Then run from your Flutter project root:

flutter_deploy

As a project dev dependency

Add to pubspec.yaml:

dev_dependencies:
  flutter_deploy: ^0.0.1

Run:

dart run flutter_deploy

Usage

Interactive mode

flutter_deploy
┌────────────────┐
│ flutter_deploy │
└────────────────┘

Stamp a build-info Dart file? [y/N]:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Current version : 1.0.0+79
  Suggested       : 1.0.0+80
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Update version? [Y/n]:
New version [Enter for 1.0.0+80]:
Sync iOS project files? [Y/n]:

  pubspec.yaml    :  1.0.0+79  →  1.0.0+80
  Info.plist      :  1.0.0 / 80
  project.pbxproj :  MARKETING_VERSION=1.0.0, CURRENT_PROJECT_VERSION=80

Apply changes? [Y/n]:
✅ pubspec.yaml → 1.0.0+80
✅ Info.plist → 1.0.0 / 80
✅ project.pbxproj → MARKETING_VERSION=1.0.0, BUILD=80

🔄 Running flutter pub get…
✅ flutter pub get succeeded.

🚀 Done! Version: 1.0.0+80

All prompts default to Y — just mash Enter for the happy path.

Non-interactive / CI mode

# Auto-increment build number, auto-detect iOS, no prompts
flutter_deploy --bump

# Set a specific version
flutter_deploy --version 1.2.0+50

# Bump build and stamp a build-info Dart constant
flutter_deploy --bump --stamp lib/constants/build_info.dart

# Bump without syncing iOS files
flutter_deploy --bump --no-ios

# Preview all changes without writing anything
flutter_deploy --dry-run

All flags

Flag Short Description
--bump -b Auto-increment build number (non-interactive)
--version <x.y.z+n> -v Set an explicit version
--[no-]ios Force or skip iOS project file sync
--stamp <path> Stamp a Dart file with the build timestamp
--no-stamp Skip build timestamp stamping
--dry-run Preview changes, write nothing
--help -h Print usage

Features

Version bumping

Reads the current version from pubspec.yaml and suggests the next build number automatically. Accept with Enter or type a custom value.

iOS project file sync

When iOS files are detected, updates:

File Field
ios/Runner/Info.plist CFBundleShortVersionString, CFBundleVersion
ios/Runner.xcodeproj/project.pbxproj MARKETING_VERSION, CURRENT_PROJECT_VERSION

Info.plist updates use PlistBuddy (macOS only).
project.pbxproj updates are pure Dart and work on all platforms.

Build timestamp stamping (optional)

Writes the current datetime to a static const String in a Dart source file:

// auto-generated — do not edit
class BuildInfo {
  static const String deployedAt = "240420261541"; // DDMMYYYYHHmm
}

Enable with --stamp <path> or answer the interactive prompt.

fvm support

flutter_deploy automatically detects and uses fvm when it is present on the PATH.


Programmatic use

The library can be used directly in Dart code:

import 'package:flutter_deploy/flutter_deploy.dart';

void main() async {
  // Version parsing and bumping
  final manager = PubspecManager();
  final current = manager.readVersion();          // FlutterVersion(1.0.0+79)
  final next    = current!.withIncrementedBuild(); // FlutterVersion(1.0.0+80)
  manager.writeVersion(next);

  // Build timestamp
  final stamper = BuildStamper(filePath: 'lib/build_info.dart');
  final ts = stamper.stamp(); // "240420261541"

  // iOS sync
  final ios = IosSync();
  ios.updatePlist(next.versionName, next.buildString);
  ios.updatePbxproj(next.versionName, next.buildString);

  // Run flutter pub get
  await PlatformUtils.flutterPubGet();
}

Platform support

Feature macOS Linux Windows
Version bump (pubspec.yaml)
project.pbxproj update
Info.plist update ❌¹ ❌¹
Build timestamp stamping
fvm auto-detection

¹ PlistBuddy is macOS-only. iOS development itself requires macOS.


Author

Ravdeep Singhubxty.cominfo.ubxty@gmail.com

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages