From a70866bee97d903648b16c14540f0d469007d367 Mon Sep 17 00:00:00 2001 From: Bryan Oltman Date: Mon, 12 Jun 2023 10:48:52 -0400 Subject: [PATCH] feat(shorebird_cli): add release instructions to `shorebird release ios` (#627) --- .../commands/release/release_ios_command.dart | 34 +++++++++++++------ .../release/release_ios_command_test.dart | 24 +++++++++++++ 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/packages/shorebird_cli/lib/src/commands/release/release_ios_command.dart b/packages/shorebird_cli/lib/src/commands/release/release_ios_command.dart index 1a3fed89..0b47a7c6 100644 --- a/packages/shorebird_cli/lib/src/commands/release/release_ios_command.dart +++ b/packages/shorebird_cli/lib/src/commands/release/release_ios_command.dart @@ -89,18 +89,17 @@ make smaller updates to your app. buildProgress.complete(); final releaseVersionProgress = logger.progress('Getting release version'); + final pubspec = getPubspecYaml()!; + final ipaPath = p.join( + Directory.current.path, + 'build', + 'ios', + 'ipa', + '${pubspec.name}.ipa', + ); String releaseVersion; try { - final pubspec = getPubspecYaml()!; - final ipa = _ipaReader.read( - p.join( - Directory.current.path, - 'build', - 'ios', - 'ipa', - '${pubspec.name}.ipa', - ), - ); + final ipa = _ipaReader.read(ipaPath); releaseVersion = ipa.versionNumber; } catch (error) { releaseVersionProgress.fail( @@ -166,7 +165,20 @@ Please bump your version number and try again.''', flutterRevision: shorebirdFlutterRevision, ); - logger.success('\n✅ Published Release!'); + final relativeIpaPath = p.relative(ipaPath); + + logger + ..success('\n✅ Published Release!') + ..info(''' + +Your next step is to upload the ipa to App Store Connect. +${lightCyan.wrap(relativeIpaPath)} + +To upload to the App Store either: + 1. Drag and drop the "$relativeIpaPath" bundle into the Apple Transporter macOS app (https://apps.apple.com/us/app/transporter/id1450874784) + 2. Run ${lightCyan.wrap('xcrun altool --upload-app --type ios -f $relativeIpaPath --apiKey your_api_key --apiIssuer your_issuer_id')}. + See "man altool" for details about how to authenticate with the App Store Connect API key. +'''); return ExitCode.success.code; } diff --git a/packages/shorebird_cli/test/src/commands/release/release_ios_command_test.dart b/packages/shorebird_cli/test/src/commands/release/release_ios_command_test.dart index 99654133..b50e4efc 100644 --- a/packages/shorebird_cli/test/src/commands/release/release_ios_command_test.dart +++ b/packages/shorebird_cli/test/src/commands/release/release_ios_command_test.dart @@ -432,6 +432,18 @@ Please bump your version number and try again.'''), ); verify(() => logger.success('\n✅ Published Release!')).called(1); + verify( + () => logger.info( + any( + that: stringContainsInOrder( + [ + 'Your next step is to upload the ipa to App Store Connect.', + 'build/ios/ipa/example.ipa', + ], + ), + ), + ), + ).called(1); expect(exitCode, ExitCode.success.code); }); @@ -456,6 +468,18 @@ flavors: ); verify(() => logger.success('\n✅ Published Release!')).called(1); + verify( + () => logger.info( + any( + that: stringContainsInOrder( + [ + 'Your next step is to upload the ipa to App Store Connect.', + 'build/ios/ipa/example.ipa', + ], + ), + ), + ), + ).called(1); expect(exitCode, ExitCode.success.code); }); });