Skip to content

Commit 72cf9e8

Browse files
authored
feat(aft): Generate list of Github tags (#6874)
1 parent e19b69c commit 72cf9e8

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

packages/aft/lib/src/commands/publish_command.dart

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,14 @@ class PublishCommand extends AmplifyCommand with GlobOptions, PublishHelpers {
213213
'dry-run',
214214
help: 'Passes `--dry-run` flag to `dart` or `flutter` publish command',
215215
negatable: false,
216+
)
217+
..addFlag(
218+
'tags',
219+
help:
220+
'Prints the list of GitHub tags that would be created for '
221+
'packages to be published, one per line, in the format '
222+
r'"${package}-v${version}".',
223+
negatable: false,
216224
);
217225
}
218226

@@ -222,6 +230,8 @@ class PublishCommand extends AmplifyCommand with GlobOptions, PublishHelpers {
222230
@override
223231
late final bool dryRun = argResults!['dry-run'] as bool;
224232

233+
late final bool tags = argResults!['tags'] as bool;
234+
225235
@override
226236
String get description =>
227237
'Publishes all packages in the Amplify Flutter repo which '
@@ -251,6 +261,16 @@ class PublishCommand extends AmplifyCommand with GlobOptions, PublishHelpers {
251261
return;
252262
}
253263

264+
// If --tags is set, print the GitHub tags and exit.
265+
if (tags) {
266+
stdout.writeln();
267+
for (final package in packagesNeedingPublish) {
268+
final version = package.pubspecInfo.pubspec.version;
269+
stdout.writeln('New tag: ${package.name}-v$version');
270+
}
271+
return;
272+
}
273+
254274
stdout
255275
..writeln('Preparing to publish${dryRun ? ' (dry run)' : ''}: ')
256276
..writeln(

0 commit comments

Comments
 (0)