-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
58 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
library; | ||
|
||
export 'src/appstore_publisher.dart' show AppStorePublisher; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:process_run/process_run.dart'; | ||
|
||
/// Publisher for App Store Connect API | ||
class AppStorePublisher { | ||
/// App manager issuer id | ||
final String issuerId; | ||
|
||
/// App manager api key | ||
final String apiKey; | ||
|
||
/// Project path | ||
final String path; | ||
|
||
late final _shell = Shell(workingDirectory: path); | ||
AppStorePublisher( | ||
{required this.issuerId, required this.apiKey, required this.path}); | ||
|
||
/// Typically in build/ios/ipa/xxx.ipa | ||
Future<void> validateIosApp({required String ipaPath}) async { | ||
await _shell.run( | ||
'xcrun altool --validate-app -f ${shellArgument(ipaPath)} -t ios --apiKey $apiKey --apiIssuer $issuerId'); | ||
} | ||
|
||
Future<void> uploadIosApp({required String ipaPath}) async { | ||
await _shell.run( | ||
'xcrun altool --upload-app -f ${shellArgument(ipaPath)} -t ios --apiKey $apiKey --apiIssuer $issuerId'); | ||
} | ||
|
||
/// Validate and upload ios app to TestFlight. | ||
Future<void> validateAndUploadIosApp({required String ipaPath}) async { | ||
await validateIosApp(ipaPath: ipaPath); | ||
await uploadIosApp(ipaPath: ipaPath); | ||
} | ||
|
||
/// Kill validate or upload task | ||
bool kill() { | ||
return _shell.kill(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters