eas-cli 5.5.0 → 5.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1741,6 +1741,7 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
1741
1741
  childBuild?: Maybe<Build>;
1742
1742
  completedAt?: Maybe<Scalars['DateTime']>;
1743
1743
  createdAt: Scalars['DateTime'];
1744
+ customNodeVersion?: Maybe<Scalars['String']>;
1744
1745
  customWorkflowName?: Maybe<Scalars['String']>;
1745
1746
  developmentClient?: Maybe<Scalars['Boolean']>;
1746
1747
  distribution?: Maybe<DistributionType>;
@@ -1789,6 +1790,7 @@ export type Build = ActivityTimelineProjectActivity & BuildOrBuildJob & {
1789
1790
  runFromCI?: Maybe<Scalars['Boolean']>;
1790
1791
  runtimeVersion?: Maybe<Scalars['String']>;
1791
1792
  sdkVersion?: Maybe<Scalars['String']>;
1793
+ selectedImage?: Maybe<Scalars['String']>;
1792
1794
  status: BuildStatus;
1793
1795
  submissions: Array<Submission>;
1794
1796
  updatedAt: Scalars['DateTime'];
@@ -1802,6 +1804,59 @@ export type BuildCanRetryArgs = {
1802
1804
  export type BuildRetryDisabledReasonArgs = {
1803
1805
  newMode?: InputMaybe<BuildMode>;
1804
1806
  };
1807
+ export type BuildAnnotation = {
1808
+ __typename?: 'BuildAnnotation';
1809
+ buildPhase: Scalars['String'];
1810
+ exampleBuildLog?: Maybe<Scalars['String']>;
1811
+ id: Scalars['ID'];
1812
+ internalNotes?: Maybe<Scalars['String']>;
1813
+ message: Scalars['String'];
1814
+ regexString: Scalars['String'];
1815
+ title: Scalars['String'];
1816
+ };
1817
+ export type BuildAnnotationDataInput = {
1818
+ buildPhase: Scalars['String'];
1819
+ exampleBuildLog?: InputMaybe<Scalars['String']>;
1820
+ internalNotes?: InputMaybe<Scalars['String']>;
1821
+ message: Scalars['String'];
1822
+ regexString: Scalars['String'];
1823
+ title: Scalars['String'];
1824
+ };
1825
+ export type BuildAnnotationFiltersInput = {
1826
+ buildPhases: Array<Scalars['String']>;
1827
+ };
1828
+ export type BuildAnnotationMutation = {
1829
+ __typename?: 'BuildAnnotationMutation';
1830
+ /** Create a Build Annotation */
1831
+ createBuildAnnotation: BuildAnnotation;
1832
+ /** Delete a Build Annotation */
1833
+ deleteBuildAnnotation: DeleteBuildAnnotationResult;
1834
+ /** Update a Build Annotation */
1835
+ updateBuildAnnotation: BuildAnnotation;
1836
+ };
1837
+ export type BuildAnnotationMutationCreateBuildAnnotationArgs = {
1838
+ buildAnnotationData: BuildAnnotationDataInput;
1839
+ };
1840
+ export type BuildAnnotationMutationDeleteBuildAnnotationArgs = {
1841
+ buildAnnotationId: Scalars['ID'];
1842
+ };
1843
+ export type BuildAnnotationMutationUpdateBuildAnnotationArgs = {
1844
+ buildAnnotationData: BuildAnnotationDataInput;
1845
+ buildAnnotationId: Scalars['ID'];
1846
+ };
1847
+ export type BuildAnnotationsQuery = {
1848
+ __typename?: 'BuildAnnotationsQuery';
1849
+ /** View build annotations */
1850
+ all: Array<BuildAnnotation>;
1851
+ /** Find a build annotation by ID */
1852
+ byId: BuildAnnotation;
1853
+ };
1854
+ export type BuildAnnotationsQueryAllArgs = {
1855
+ filters?: InputMaybe<BuildAnnotationFiltersInput>;
1856
+ };
1857
+ export type BuildAnnotationsQueryByIdArgs = {
1858
+ buildAnnotationId: Scalars['ID'];
1859
+ };
1805
1860
  export type BuildArtifact = {
1806
1861
  __typename?: 'BuildArtifact';
1807
1862
  manifestPlistUrl?: Maybe<Scalars['String']>;
@@ -1846,6 +1901,8 @@ export type BuildFilter = {
1846
1901
  };
1847
1902
  export type BuildFilterInput = {
1848
1903
  channel?: InputMaybe<Scalars['String']>;
1904
+ developmentClient?: InputMaybe<Scalars['Boolean']>;
1905
+ distributions?: InputMaybe<Array<DistributionType>>;
1849
1906
  platforms?: InputMaybe<Array<AppPlatform>>;
1850
1907
  releaseChannel?: InputMaybe<Scalars['String']>;
1851
1908
  };
@@ -1935,6 +1992,7 @@ export type BuildMetadataInput = {
1935
1992
  channel?: InputMaybe<Scalars['String']>;
1936
1993
  cliVersion?: InputMaybe<Scalars['String']>;
1937
1994
  credentialsSource?: InputMaybe<BuildCredentialsSource>;
1995
+ customNodeVersion?: InputMaybe<Scalars['String']>;
1938
1996
  customWorkflowName?: InputMaybe<Scalars['String']>;
1939
1997
  developmentClient?: InputMaybe<Scalars['Boolean']>;
1940
1998
  distribution?: InputMaybe<DistributionType>;
@@ -1950,6 +2008,7 @@ export type BuildMetadataInput = {
1950
2008
  runWithNoWaitFlag?: InputMaybe<Scalars['Boolean']>;
1951
2009
  runtimeVersion?: InputMaybe<Scalars['String']>;
1952
2010
  sdkVersion?: InputMaybe<Scalars['String']>;
2011
+ selectedImage?: InputMaybe<Scalars['String']>;
1953
2012
  trackingContext?: InputMaybe<Scalars['JSONObject']>;
1954
2013
  username?: InputMaybe<Scalars['String']>;
1955
2014
  workflow?: InputMaybe<BuildWorkflow>;
@@ -2155,12 +2214,14 @@ export declare enum BuildResourceClass {
2155
2214
  AndroidLarge = "ANDROID_LARGE",
2156
2215
  AndroidMedium = "ANDROID_MEDIUM",
2157
2216
  IosDefault = "IOS_DEFAULT",
2158
- /** @deprecated Use IOS_INTEL_MEDIUM instead */
2217
+ /** @deprecated No longer available. Use IOS_M_LARGE instead. */
2159
2218
  IosIntelLarge = "IOS_INTEL_LARGE",
2219
+ /** @deprecated No longer available. Use IOS_M_MEDIUM instead. */
2160
2220
  IosIntelMedium = "IOS_INTEL_MEDIUM",
2161
2221
  IosLarge = "IOS_LARGE",
2162
2222
  /** @deprecated Use IOS_M_MEDIUM instead */
2163
2223
  IosM1Large = "IOS_M1_LARGE",
2224
+ /** @deprecated Use IOS_M_MEDIUM instead */
2164
2225
  IosM1Medium = "IOS_M1_MEDIUM",
2165
2226
  IosMedium = "IOS_MEDIUM",
2166
2227
  IosMLarge = "IOS_M_LARGE",
@@ -2340,6 +2401,10 @@ export type DeleteAppleProvisioningProfileResult = {
2340
2401
  __typename?: 'DeleteAppleProvisioningProfileResult';
2341
2402
  id: Scalars['ID'];
2342
2403
  };
2404
+ export type DeleteBuildAnnotationResult = {
2405
+ __typename?: 'DeleteBuildAnnotationResult';
2406
+ buildAnnotationId: Scalars['ID'];
2407
+ };
2343
2408
  export type DeleteDiscordUserResult = {
2344
2409
  __typename?: 'DeleteDiscordUserResult';
2345
2410
  id: Scalars['ID'];
@@ -2709,6 +2774,7 @@ export type GitHubAppQuery = {
2709
2774
  environment: GitHubAppEnvironment;
2710
2775
  installation: GitHubAppInstallation;
2711
2776
  name: Scalars['String'];
2777
+ /** @deprecated */
2712
2778
  searchRepositories: GitHubRepositoryPaginationResult;
2713
2779
  };
2714
2780
  export type GitHubAppQueryInstallationArgs = {
@@ -2861,6 +2927,8 @@ export type GitHubUserMutation = {
2861
2927
  __typename?: 'GitHubUserMutation';
2862
2928
  /** Delete a GitHub User by ID */
2863
2929
  deleteGitHubUser: DeleteGitHubUserResult;
2930
+ /** Generate a GitHub User Access Token */
2931
+ generateGitHubUserAccessToken?: Maybe<Scalars['String']>;
2864
2932
  };
2865
2933
  export type GitHubUserMutationDeleteGitHubUserArgs = {
2866
2934
  id: Scalars['ID'];
@@ -3209,7 +3277,8 @@ export declare enum MailchimpAudience {
3209
3277
  }
3210
3278
  export declare enum MailchimpTag {
3211
3279
  DevClientUsers = "DEV_CLIENT_USERS",
3212
- EasMasterList = "EAS_MASTER_LIST"
3280
+ EasMasterList = "EAS_MASTER_LIST",
3281
+ NewsletterSignupList = "NEWSLETTER_SIGNUP_LIST"
3213
3282
  }
3214
3283
  export type MailchimpTagPayload = {
3215
3284
  __typename?: 'MailchimpTagPayload';
@@ -3619,6 +3688,8 @@ export type RootMutation = {
3619
3688
  asset: AssetMutation;
3620
3689
  /** Mutations that modify an EAS Build */
3621
3690
  build: BuildMutation;
3691
+ /** Mutations that create, update, and delete Build Annotations */
3692
+ buildAnnotation: BuildAnnotationMutation;
3622
3693
  /** Mutations that modify an BuildJob */
3623
3694
  buildJob: BuildJobMutation;
3624
3695
  /** Mutations for Discord users */
@@ -3713,6 +3784,8 @@ export type RootQuery = {
3713
3784
  appleTeam: AppleTeamQuery;
3714
3785
  asset: AssetQuery;
3715
3786
  backgroundJobReceipt: BackgroundJobReceiptQuery;
3787
+ /** Top-level query object for querying annotations. */
3788
+ buildAnnotations: BuildAnnotationsQuery;
3716
3789
  buildJobs: BuildJobQuery;
3717
3790
  buildOrBuildJob: BuildOrBuildJobQuery;
3718
3791
  /** Top-level query object for querying BuildPublicData publicly. */
@@ -8261,6 +8334,7 @@ export type CreateAndroidBuildMutation = {
8261
8334
  buildUrl?: string | null;
8262
8335
  xcodeBuildLogsUrl?: string | null;
8263
8336
  applicationArchiveUrl?: string | null;
8337
+ buildArtifactsUrl?: string | null;
8264
8338
  } | null;
8265
8339
  initiatingActor?: {
8266
8340
  __typename: 'Robot';
@@ -8349,6 +8423,7 @@ export type CreateIosBuildMutation = {
8349
8423
  buildUrl?: string | null;
8350
8424
  xcodeBuildLogsUrl?: string | null;
8351
8425
  applicationArchiveUrl?: string | null;
8426
+ buildArtifactsUrl?: string | null;
8352
8427
  } | null;
8353
8428
  initiatingActor?: {
8354
8429
  __typename: 'Robot';
@@ -8433,6 +8508,7 @@ export type UpdateBuildMetadataMutation = {
8433
8508
  buildUrl?: string | null;
8434
8509
  xcodeBuildLogsUrl?: string | null;
8435
8510
  applicationArchiveUrl?: string | null;
8511
+ buildArtifactsUrl?: string | null;
8436
8512
  } | null;
8437
8513
  initiatingActor?: {
8438
8514
  __typename: 'Robot';
@@ -8511,6 +8587,7 @@ export type RetryIosBuildMutation = {
8511
8587
  buildUrl?: string | null;
8512
8588
  xcodeBuildLogsUrl?: string | null;
8513
8589
  applicationArchiveUrl?: string | null;
8590
+ buildArtifactsUrl?: string | null;
8514
8591
  } | null;
8515
8592
  initiatingActor?: {
8516
8593
  __typename: 'Robot';
@@ -9170,6 +9247,7 @@ export type BuildsByIdQuery = {
9170
9247
  buildUrl?: string | null;
9171
9248
  xcodeBuildLogsUrl?: string | null;
9172
9249
  applicationArchiveUrl?: string | null;
9250
+ buildArtifactsUrl?: string | null;
9173
9251
  } | null;
9174
9252
  initiatingActor?: {
9175
9253
  __typename: 'Robot';
@@ -9282,6 +9360,7 @@ export type BuildsWithSubmissionsByIdQuery = {
9282
9360
  buildUrl?: string | null;
9283
9361
  xcodeBuildLogsUrl?: string | null;
9284
9362
  applicationArchiveUrl?: string | null;
9363
+ buildArtifactsUrl?: string | null;
9285
9364
  } | null;
9286
9365
  initiatingActor?: {
9287
9366
  __typename: 'Robot';
@@ -9365,6 +9444,7 @@ export type ViewBuildsOnAppQuery = {
9365
9444
  buildUrl?: string | null;
9366
9445
  xcodeBuildLogsUrl?: string | null;
9367
9446
  applicationArchiveUrl?: string | null;
9447
+ buildArtifactsUrl?: string | null;
9368
9448
  } | null;
9369
9449
  initiatingActor?: {
9370
9450
  __typename: 'Robot';
@@ -10243,6 +10323,7 @@ export type BuildFragment = {
10243
10323
  buildUrl?: string | null;
10244
10324
  xcodeBuildLogsUrl?: string | null;
10245
10325
  applicationArchiveUrl?: string | null;
10326
+ buildArtifactsUrl?: string | null;
10246
10327
  } | null;
10247
10328
  initiatingActor?: {
10248
10329
  __typename: 'Robot';
@@ -10346,6 +10427,7 @@ export type BuildWithSubmissionsFragment = {
10346
10427
  buildUrl?: string | null;
10347
10428
  xcodeBuildLogsUrl?: string | null;
10348
10429
  applicationArchiveUrl?: string | null;
10430
+ buildArtifactsUrl?: string | null;
10349
10431
  } | null;
10350
10432
  initiatingActor?: {
10351
10433
  __typename: 'Robot';
@@ -204,12 +204,14 @@ var BuildResourceClass;
204
204
  BuildResourceClass["AndroidLarge"] = "ANDROID_LARGE";
205
205
  BuildResourceClass["AndroidMedium"] = "ANDROID_MEDIUM";
206
206
  BuildResourceClass["IosDefault"] = "IOS_DEFAULT";
207
- /** @deprecated Use IOS_INTEL_MEDIUM instead */
207
+ /** @deprecated No longer available. Use IOS_M_LARGE instead. */
208
208
  BuildResourceClass["IosIntelLarge"] = "IOS_INTEL_LARGE";
209
+ /** @deprecated No longer available. Use IOS_M_MEDIUM instead. */
209
210
  BuildResourceClass["IosIntelMedium"] = "IOS_INTEL_MEDIUM";
210
211
  BuildResourceClass["IosLarge"] = "IOS_LARGE";
211
212
  /** @deprecated Use IOS_M_MEDIUM instead */
212
213
  BuildResourceClass["IosM1Large"] = "IOS_M1_LARGE";
214
+ /** @deprecated Use IOS_M_MEDIUM instead */
213
215
  BuildResourceClass["IosM1Medium"] = "IOS_M1_MEDIUM";
214
216
  BuildResourceClass["IosMedium"] = "IOS_MEDIUM";
215
217
  BuildResourceClass["IosMLarge"] = "IOS_M_LARGE";
@@ -364,6 +366,7 @@ var MailchimpTag;
364
366
  (function (MailchimpTag) {
365
367
  MailchimpTag["DevClientUsers"] = "DEV_CLIENT_USERS";
366
368
  MailchimpTag["EasMasterList"] = "EAS_MASTER_LIST";
369
+ MailchimpTag["NewsletterSignupList"] = "NEWSLETTER_SIGNUP_LIST";
367
370
  })(MailchimpTag = exports.MailchimpTag || (exports.MailchimpTag = {}));
368
371
  var NotificationEvent;
369
372
  (function (NotificationEvent) {
@@ -19,6 +19,7 @@ exports.BuildFragmentNode = (0, graphql_tag_1.default) `
19
19
  buildUrl
20
20
  xcodeBuildLogsUrl
21
21
  applicationArchiveUrl
22
+ buildArtifactsUrl
22
23
  }
23
24
  initiatingActor {
24
25
  __typename
@@ -11,7 +11,7 @@ const semver_1 = tslib_1.__importDefault(require("semver"));
11
11
  const api_1 = require("../api");
12
12
  const generated_1 = require("../graphql/generated");
13
13
  const AppQuery_1 = require("../graphql/queries/AppQuery");
14
- const log_1 = tslib_1.__importDefault(require("../log"));
14
+ const log_1 = tslib_1.__importStar(require("../log"));
15
15
  const expoCli_1 = require("../utils/expoCli");
16
16
  function getUsername(exp, user) {
17
17
  switch (user.__typename) {
@@ -109,7 +109,7 @@ async function enforceRollBackToEmbeddedUpdateSupportAsync(projectDir) {
109
109
  return;
110
110
  }
111
111
  }
112
- throw new Error('The expo-updates package must have a version >= 0.19.0 to use roll back to embedded, which corresponds to Expo SDK 50 or greater.');
112
+ throw new Error(`The expo-updates package must have a version >= 0.19.0 to use roll back to embedded, which corresponds to Expo SDK 50 or greater. ${(0, log_1.learnMore)('https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/')}`);
113
113
  }
114
114
  exports.enforceRollBackToEmbeddedUpdateSupportAsync = enforceRollBackToEmbeddedUpdateSupportAsync;
115
115
  async function installExpoUpdatesAsync(projectDir, options) {
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const eas_json_1 = require("@expo/eas-json");
5
6
  const results_1 = require("@expo/results");
6
7
  const generated_1 = require("../../graphql/generated");
7
8
  const log_1 = tslib_1.__importDefault(require("../../log"));
8
9
  const applicationId_1 = require("../../project/android/applicationId");
9
10
  const capitalize_1 = tslib_1.__importDefault(require("../../utils/expodash/capitalize"));
11
+ const ArchiveSource_1 = require("../ArchiveSource");
10
12
  const commons_1 = require("../commons");
11
13
  const AndroidSubmitter_1 = tslib_1.__importDefault(require("./AndroidSubmitter"));
12
14
  const ServiceAccountSource_1 = require("./ServiceAccountSource");
@@ -15,18 +17,34 @@ class AndroidSubmitCommand {
15
17
  this.ctx = ctx;
16
18
  }
17
19
  async runAsync() {
20
+ var _a;
18
21
  log_1.default.addNewLineIfNone();
19
- const submissionOptions = await this.getAndroidSubmissionOptionsAsync();
20
- const submitter = new AndroidSubmitter_1.default(this.ctx, submissionOptions);
22
+ const archiveSource = this.resolveArchiveSource();
23
+ if (!archiveSource.ok) {
24
+ log_1.default.error((_a = archiveSource.reason) === null || _a === void 0 ? void 0 : _a.message);
25
+ throw new Error('Submission failed');
26
+ }
27
+ const archiveSourceValue = archiveSource.enforceValue();
28
+ const archive = await (0, ArchiveSource_1.getArchiveAsync)({
29
+ graphqlClient: this.ctx.graphqlClient,
30
+ platform: eas_build_job_1.Platform.ANDROID,
31
+ projectId: this.ctx.projectId,
32
+ nonInteractive: this.ctx.nonInteractive,
33
+ }, archiveSourceValue);
34
+ const archiveProfile = archive.sourceType === ArchiveSource_1.ArchiveSourceType.build ? archive.build.buildProfile : undefined;
35
+ if (archiveProfile && !this.ctx.specifiedProfile) {
36
+ this.ctx = await (0, commons_1.refreshContextSubmitProfileAsync)(this.ctx, archiveProfile);
37
+ }
38
+ const submissionOptions = await this.getAndroidSubmissionOptionsAsync(archiveSourceValue);
39
+ const submitter = new AndroidSubmitter_1.default(this.ctx, submissionOptions, archive);
21
40
  return await submitter.submitAsync();
22
41
  }
23
- async getAndroidSubmissionOptionsAsync() {
42
+ async getAndroidSubmissionOptionsAsync(archiveSource) {
24
43
  const track = this.resolveTrack();
25
44
  const releaseStatus = this.resolveReleaseStatus();
26
- const archiveSource = this.resolveArchiveSource();
27
45
  const rollout = this.resolveRollout();
28
46
  const serviceAccountSource = await this.resolveServiceAccountSourceAsync();
29
- const errored = [track, releaseStatus, archiveSource, serviceAccountSource, rollout].filter(r => !r.ok);
47
+ const errored = [track, releaseStatus, serviceAccountSource, rollout].filter(r => !r.ok);
30
48
  if (errored.length > 0) {
31
49
  const message = errored.map(err => { var _a; return (_a = err.reason) === null || _a === void 0 ? void 0 : _a.message; }).join('\n');
32
50
  log_1.default.error(message);
@@ -37,7 +55,7 @@ class AndroidSubmitCommand {
37
55
  track: track.enforceValue(),
38
56
  releaseStatus: releaseStatus.enforceValue(),
39
57
  rollout: rollout.enforceValue(),
40
- archiveSource: archiveSource.enforceValue(),
58
+ archiveSource,
41
59
  serviceAccountSource: serviceAccountSource.enforceValue(),
42
60
  changesNotSentForReview: this.ctx.profile.changesNotSentForReview,
43
61
  };
@@ -14,7 +14,7 @@ interface ResolvedSourceOptions {
14
14
  serviceAccountKeyResult: ServiceAccountKeyResult;
15
15
  }
16
16
  export default class AndroidSubmitter extends BaseSubmitter<Platform.ANDROID, ResolvedSourceOptions, AndroidSubmissionOptions> {
17
- constructor(ctx: SubmissionContext<Platform.ANDROID>, options: AndroidSubmissionOptions);
17
+ constructor(ctx: SubmissionContext<Platform.ANDROID>, options: AndroidSubmissionOptions, archive: ResolvedArchiveSource);
18
18
  createSubmissionInputAsync(resolvedSourceOptions: ResolvedSourceOptions): Promise<SubmissionInput<Platform.ANDROID>>;
19
19
  protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }: SubmissionInput<Platform.ANDROID>): Promise<SubmissionFragment>;
20
20
  private formatSubmissionConfig;
@@ -1,25 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const eas_build_job_1 = require("@expo/eas-build-job");
5
4
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
5
  const AnalyticsManager_1 = require("../../analytics/AnalyticsManager");
7
6
  const SubmissionMutation_1 = require("../../graphql/mutations/SubmissionMutation");
8
7
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
9
- const ArchiveSource_1 = require("../ArchiveSource");
10
8
  const BaseSubmitter_1 = tslib_1.__importDefault(require("../BaseSubmitter"));
11
9
  const summary_1 = require("../utils/summary");
12
10
  const ServiceAccountSource_1 = require("./ServiceAccountSource");
13
11
  class AndroidSubmitter extends BaseSubmitter_1.default {
14
- constructor(ctx, options) {
12
+ constructor(ctx, options, archive) {
15
13
  const sourceOptionsResolver = {
16
14
  // eslint-disable-next-line async-protect/async-suffix
17
- archive: async () => await (0, ArchiveSource_1.getArchiveAsync)({
18
- graphqlClient: ctx.graphqlClient,
19
- platform: eas_build_job_1.Platform.ANDROID,
20
- projectId: ctx.projectId,
21
- nonInteractive: ctx.nonInteractive,
22
- }, this.options.archiveSource),
15
+ archive: async () => archive,
23
16
  // eslint-disable-next-line async-protect/async-suffix
24
17
  serviceAccountKeyResult: async () => {
25
18
  return await (0, ServiceAccountSource_1.getServiceAccountKeyResultAsync)(this.ctx, this.options.serviceAccountSource);
@@ -2,3 +2,4 @@ import { Platform } from '@expo/eas-build-job';
2
2
  import { ArchiveSource } from './ArchiveSource';
3
3
  import { SubmissionContext } from './context';
4
4
  export declare function resolveArchiveSource<T extends Platform>(ctx: SubmissionContext<T>): ArchiveSource;
5
+ export declare function refreshContextSubmitProfileAsync<T extends Platform>(ctx: SubmissionContext<T>, archiveProfile: string): Promise<SubmissionContext<T>>;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveArchiveSource = void 0;
3
+ exports.refreshContextSubmitProfileAsync = exports.resolveArchiveSource = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const eas_json_1 = require("@expo/eas-json");
6
+ const errors_1 = require("@expo/eas-json/build/errors");
7
+ const log_1 = tslib_1.__importDefault(require("../log"));
4
8
  const ArchiveSource_1 = require("./ArchiveSource");
5
9
  function resolveArchiveSource(ctx) {
6
10
  const { url, path, id, latest } = ctx.archiveFlags;
@@ -44,3 +48,18 @@ function resolveArchiveSource(ctx) {
44
48
  }
45
49
  }
46
50
  exports.resolveArchiveSource = resolveArchiveSource;
51
+ async function refreshContextSubmitProfileAsync(ctx, archiveProfile) {
52
+ try {
53
+ ctx.profile = (await eas_json_1.EasJsonUtils.getSubmitProfileAsync(eas_json_1.EasJsonAccessor.fromProjectPath(ctx.projectDir), ctx.platform, archiveProfile ? archiveProfile : 'production'));
54
+ }
55
+ catch (err) {
56
+ if (err instanceof errors_1.MissingProfileError) {
57
+ log_1.default.log(`Selected build uses "${archiveProfile}" build profile but a submit profile with the same name is missing in eas.json. Using default ("production") profile`);
58
+ }
59
+ else {
60
+ throw err;
61
+ }
62
+ }
63
+ return ctx;
64
+ }
65
+ exports.refreshContextSubmitProfileAsync = refreshContextSubmitProfileAsync;
@@ -23,6 +23,7 @@ export interface SubmissionContext<T extends Platform> {
23
23
  analytics: Analytics;
24
24
  vcsClient: Client;
25
25
  applicationIdentifierOverride?: string;
26
+ specifiedProfile?: string;
26
27
  }
27
28
  export interface SubmitArchiveFlags {
28
29
  latest?: boolean;
@@ -45,4 +46,5 @@ export declare function createSubmissionContextAsync<T extends Platform>(params:
45
46
  exp: ExpoConfig;
46
47
  projectId: string;
47
48
  vcsClient: Client;
49
+ specifiedProfile?: string;
48
50
  }): Promise<SubmissionContext<T>>;
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
5
  const results_1 = require("@expo/results");
5
6
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
7
  const getenv_1 = tslib_1.__importDefault(require("getenv"));
7
8
  const wrap_ansi_1 = tslib_1.__importDefault(require("wrap-ansi"));
8
9
  const errors_1 = require("../../credentials/errors");
9
10
  const log_1 = tslib_1.__importStar(require("../../log"));
11
+ const ArchiveSource_1 = require("../ArchiveSource");
10
12
  const commons_1 = require("../commons");
11
13
  const AppProduce_1 = require("./AppProduce");
12
14
  const AppSpecificPasswordSource_1 = require("./AppSpecificPasswordSource");
@@ -17,13 +19,29 @@ class IosSubmitCommand {
17
19
  this.ctx = ctx;
18
20
  }
19
21
  async runAsync() {
22
+ var _a;
20
23
  log_1.default.addNewLineIfNone();
21
- const options = await this.resolveSubmissionOptionsAsync();
22
- const submitter = new IosSubmitter_1.default(this.ctx, options);
24
+ const archiveSource = this.resolveArchiveSource();
25
+ if (!archiveSource.ok) {
26
+ log_1.default.error((_a = archiveSource.reason) === null || _a === void 0 ? void 0 : _a.message);
27
+ throw new Error('Submission failed');
28
+ }
29
+ const archiveSourceValue = archiveSource.enforceValue();
30
+ const archive = await (0, ArchiveSource_1.getArchiveAsync)({
31
+ graphqlClient: this.ctx.graphqlClient,
32
+ platform: eas_build_job_1.Platform.IOS,
33
+ projectId: this.ctx.projectId,
34
+ nonInteractive: this.ctx.nonInteractive,
35
+ }, archiveSourceValue);
36
+ const archiveProfile = archive.sourceType === ArchiveSource_1.ArchiveSourceType.build ? archive.build.buildProfile : undefined;
37
+ if (archiveProfile && !this.ctx.specifiedProfile) {
38
+ this.ctx = await (0, commons_1.refreshContextSubmitProfileAsync)(this.ctx, archiveProfile);
39
+ }
40
+ const options = await this.resolveSubmissionOptionsAsync(archiveSourceValue);
41
+ const submitter = new IosSubmitter_1.default(this.ctx, options, archive);
23
42
  return await submitter.submitAsync();
24
43
  }
25
- async resolveSubmissionOptionsAsync() {
26
- const archiveSource = this.resolveArchiveSource();
44
+ async resolveSubmissionOptionsAsync(archiveSource) {
27
45
  const credentialsSource = await this.resolveCredentialSubmissionOptionsAsync();
28
46
  const maybeAppSpecificPasswordSource = 'appSpecificPasswordSource' in credentialsSource
29
47
  ? credentialsSource.appSpecificPasswordSource
@@ -31,7 +49,6 @@ class IosSubmitCommand {
31
49
  const maybeAscApiKeySource = 'ascApiKeySource' in credentialsSource ? credentialsSource.ascApiKeySource : null;
32
50
  const ascAppIdentifier = await this.resolveAscAppIdentifierAsync();
33
51
  const errored = [
34
- archiveSource,
35
52
  ...(maybeAppSpecificPasswordSource ? [maybeAppSpecificPasswordSource] : []),
36
53
  ...(maybeAscApiKeySource ? [maybeAscApiKeySource] : []),
37
54
  ascAppIdentifier,
@@ -44,7 +61,7 @@ class IosSubmitCommand {
44
61
  return {
45
62
  projectId: this.ctx.projectId,
46
63
  ascAppIdentifier: ascAppIdentifier.enforceValue(),
47
- archiveSource: archiveSource.enforceValue(),
64
+ archiveSource,
48
65
  ...(maybeAppSpecificPasswordSource
49
66
  ? {
50
67
  appSpecificPasswordSource: maybeAppSpecificPasswordSource.enforceValue(),
@@ -19,7 +19,7 @@ interface ResolvedSourceOptions {
19
19
  };
20
20
  }
21
21
  export default class IosSubmitter extends BaseSubmitter<Platform.IOS, ResolvedSourceOptions, IosSubmissionOptions> {
22
- constructor(ctx: SubmissionContext<Platform.IOS>, options: IosSubmissionOptions);
22
+ constructor(ctx: SubmissionContext<Platform.IOS>, options: IosSubmissionOptions, archive: ResolvedArchiveSource);
23
23
  createSubmissionInputAsync(resolvedSourceOptions: ResolvedSourceOptions): Promise<SubmissionInput<Platform.IOS>>;
24
24
  protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }: SubmissionInput<Platform.IOS>): Promise<SubmissionFragment>;
25
25
  private formatSubmissionConfig;
@@ -1,26 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const eas_build_job_1 = require("@expo/eas-build-job");
5
4
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
5
  const AnalyticsManager_1 = require("../../analytics/AnalyticsManager");
7
6
  const SubmissionMutation_1 = require("../../graphql/mutations/SubmissionMutation");
8
7
  const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
9
- const ArchiveSource_1 = require("../ArchiveSource");
10
8
  const BaseSubmitter_1 = tslib_1.__importDefault(require("../BaseSubmitter"));
11
9
  const summary_1 = require("../utils/summary");
12
10
  const AppSpecificPasswordSource_1 = require("./AppSpecificPasswordSource");
13
11
  const AscApiKeySource_1 = require("./AscApiKeySource");
14
12
  class IosSubmitter extends BaseSubmitter_1.default {
15
- constructor(ctx, options) {
13
+ constructor(ctx, options, archive) {
16
14
  const sourceOptionsResolver = {
17
15
  // eslint-disable-next-line async-protect/async-suffix
18
- archive: async () => await (0, ArchiveSource_1.getArchiveAsync)({
19
- graphqlClient: ctx.graphqlClient,
20
- platform: eas_build_job_1.Platform.IOS,
21
- projectId: ctx.projectId,
22
- nonInteractive: ctx.nonInteractive,
23
- }, this.options.archiveSource),
16
+ archive: async () => archive,
24
17
  // eslint-disable-next-line async-protect/async-suffix
25
18
  credentials: async () => {
26
19
  const maybeAppSpecificPassword = this.options.appSpecificPasswordSource