Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deployment of macOS (flavor support) #1203

Merged
merged 1 commit into from
Dec 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ final _macOsStageToTracks = {
'alpha': const TestFlightTrack('alpha'),
};

/// The different flavors of the macOS app that support deployment.
final _macOsFlavors = [
'prod',
'dev',
];

/// [DeployMacOsCommand] provides functionality for deploying the Sharezone macOS
/// app to the App Store or TestFlight.
///
Expand Down Expand Up @@ -57,6 +63,12 @@ class DeployMacOsCommand extends CommandBase {
'The deployment stage to deploy to. The "stable" stage is used for App Store releases, the "alpha" stage is used for TestFlight releases. The value will be forwarded to the "sz build" command.',
defaultsTo: 'stable',
);
argParser.addOption(
flavorOptionName,
allowed: _macOsFlavors,
help: 'The flavor to build for. Only the "prod" flavor is supported.',
defaultsTo: 'prod',
);

addAppStoreConnectKeyIdOption(argParser);
addAppStoreConnectIssuerIdOption(argParser);
Expand All @@ -65,6 +77,8 @@ class DeployMacOsCommand extends CommandBase {
addWhatsNewOption(argParser);
}

static const flavorOptionName = 'flavor';

List<String> get _macOsStages => _macOsStageToTracks.keys.toList();

@override
Expand Down Expand Up @@ -142,6 +156,7 @@ class DeployMacOsCommand extends CommandBase {
Future<void> _buildApp(ProcessRunner processRunner,
{required int buildNumber}) async {
try {
final flavor = argResults![flavorOptionName] as String;
final stage = argResults![releaseStageOptionName] as String;
await processRunner.run(
[
Expand All @@ -151,6 +166,8 @@ class DeployMacOsCommand extends CommandBase {
'sz_repo_cli',
'build',
'macos',
'--flavor',
flavor,
'--stage',
stage,
'--build-number',
Expand Down
Loading