flutter_ci 0.0.3
flutter_ci: ^0.0.3 copied to clipboard
CLI tool for Flutter CI/CD: bumps pubspec versions, builds Android and iOS artifacts, stores them in versioned folders, tags releases and distributes builds.
0.0.3 #
This release fixes several problems that hid failures from CI. Read Behavior changes before upgrading.
Behavior changes #
- Non-zero exit codes. Failed builds, tests, pre-build steps, git operations, uploads and notifications now exit with code 1, and invalid command-line usage exits with 64. Previously every run exited 0, so CI pipelines passed even when the build failed.
- Command-line flags override
flutter_ci.yaml. Previously the YAML won, so--platform,--no-bump,--flavorand similar flags were silently ignored whenever the file set them, including in the file generated byflutter_ci init. - Invalid configuration is an error. Invalid YAML, unknown
platform,android.formatorios.methodvalues, and wrongly typed values (such asversion_bump: "yes") now stop the build with a clear message instead of silently building with defaults. - Safer release order.
releasenow builds before committing and tagging. A failed build no longer leaves behind a tag or commit, and no uploads are attempted.CHANGELOG.mdis included in the release commit. - Release notes cover the commits since the last tag instead of always
the last 10 commits.
--changelognow implies--notes. --app-storeand--play-storework on their own. Previously they did nothing without--upload.GitService.commitChangesandGitService.createTagthrow aFlutterCiExceptionon failure instead of only logging.commitChangescommits just the given files, leaving other staged changes alone.DistributionServiceupload and webhook methods returnFuture<bool>(trueon success) instead ofFuture<void>.- Google Drive uploads use the
gdrive3.x syntax (gdrive files upload), because the 2.x CLI no longer works with Google's APIs. - Errors and warnings are written to stderr. Set
NO_COLORto disable colors.
Bug fixes #
- Parallel builds with custom Android and iOS commands no longer overwrite each other's temporary script. Previously one platform could run the other's command.
build.lognow records every command and its output, including the output of failed commands. Previously it contained a literal$cmdline and no output for failures.- Slack webhooks now send valid JSON, and Discord webhooks use Discord's
contentfield. Previously any message containing quotes or newlines (always the case with release notes) failed to send. - Firebase release notes containing newlines or quotes are passed correctly.
- Dart-define values containing spaces or shell characters are passed intact.
- Play Store uploads use
--aabfor app bundles. Previously--apkwas always used. - Firebase, App Store and Play Store uploads pick an artifact that exists (for example the IPA for iOS Firebase app IDs) instead of always assuming an APK path.
- Flavored app bundles (
build/app/outputs/bundle/<flavor>Release/) are now collected. - Stale artifacts from earlier builds are no longer stored. When a build
produces several files of one type (such as
--split-per-abiAPKs), each is kept under a distinct name instead of overwriting the others. listsorts by version (v1.0.0+10beforev1.0.0+9).- Notifications no longer include
Release Notes: nullwhen notes were not generated. - A version without a build number (for example
--version 2.0.0) no longer passes--build-number=0to Flutter. - Invalid versions (
--version foo), a missingversionfield and a missingpubspec.yamlproduce clear errors instead of type errors. - When one platform fails, the artifacts of the platforms that succeeded are still stored.
doctorexits with code 1 when a required tool is missing.
Security #
- Dart-define values are no longer printed to the console or
build.log. Only their keys are shown. - The App Store password is passed to
altoolthrough an environment variable instead of on the command line, so it no longer appears in CI logs. - Webhook URLs, which act as credentials, are no longer printed.
- A warning names any
${VAR}influtter_ci.yamlthat is not set.
Improvements #
--helpfor every command (flutter_ci build --help,flutter_ci help release) and a global--versionflag.- On hosts other than macOS,
platform: bothskips the iOS build with a warning instead of failing it. - New
trackoption for Play Store uploads. build_info.jsonalso records the app name and the stored artifact names, and is pretty-printed.- New public API:
FlutterCiException,packageVersion,Logger.warning,ConfigService.getString/getBool,GitService.getCommitsSinceLastTag,BuildService.testWithCoverage, adartDefinesparameter onBuildService.buildAndroid/buildIOS, abuiltAfterparameter onStorageService.storeArtifacts(which now returns the stored files), and atrackparameter onDistributionService.uploadToPlayStore. - The README documents configuration precedence, exit codes, the release order, artifact naming, secrets handling, and a working GitHub Actions setup.
Deprecations #
- The unused
shellfields onBuildService,DistributionServiceandGitServiceare deprecated and will be removed in 1.0.0.
Compatibility #
- The minimum Dart SDK is now 3.5, which is what the dependencies already
required. The previous
>=2.17.0constraint could not actually be satisfied.
0.0.2 #
- Added
flutter_ci doctorfor environment diagnostics. - Added
flutter_ci initfor configuration scaffolding. - Added
flutter_ci listfor browsing previous builds. - Added
--flavorsupport for build commands. - Added automatic build output logging to
build.log. - Enhanced security with environment variable interpolation in
flutter_ci.yaml. - Added GitHub Actions example and Pub.dev badges to README.
- Upgraded dependencies for improved stability and pub points.
0.0.1 #
- Initial release.
- Added build and bump commands.
- Integrated Android and iOS build support.
- Added artifact storage service to local storage.