eas-cli 2.7.1 → 2.9.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.
Files changed (61) hide show
  1. package/README.md +78 -53
  2. package/build/branch/queries.d.ts +1 -0
  3. package/build/branch/queries.js +2 -2
  4. package/build/build/build.d.ts +1 -1
  5. package/build/build/build.js +2 -2
  6. package/build/build/createContext.js +1 -0
  7. package/build/build/graphql.js +6 -0
  8. package/build/build/local.js +1 -1
  9. package/build/build/queries.d.ts +4 -2
  10. package/build/build/queries.js +32 -7
  11. package/build/build/runBuildAndSubmit.js +31 -2
  12. package/build/commands/build/run.d.ts +0 -1
  13. package/build/commands/build/run.js +32 -12
  14. package/build/commands/submit.js +1 -1
  15. package/build/commands/update/index.js +20 -8
  16. package/build/devices/utils/formatDevice.js +1 -2
  17. package/build/graphql/generated.d.ts +15 -0
  18. package/build/graphql/generated.js +9 -2
  19. package/build/graphql/mutations/SubmissionMutation.js +14 -2
  20. package/build/graphql/mutations/UploadSessionMutation.d.ts +4 -3
  21. package/build/project/applicationIdentifier.js +6 -2
  22. package/build/run/android/aapt.d.ts +5 -0
  23. package/build/run/android/aapt.js +51 -0
  24. package/build/run/android/adb.d.ts +23 -0
  25. package/build/run/android/adb.js +120 -0
  26. package/build/run/android/emulator.d.ts +7 -0
  27. package/build/run/android/emulator.js +109 -0
  28. package/build/run/android/run.d.ts +1 -1
  29. package/build/run/android/run.js +10 -3
  30. package/build/run/android/sdk.d.ts +3 -0
  31. package/build/run/android/sdk.js +29 -0
  32. package/build/run/android/systemRequirements.d.ts +1 -0
  33. package/build/run/android/systemRequirements.js +24 -0
  34. package/build/run/ios/simulator.js +1 -1
  35. package/build/run/utils.d.ts +2 -0
  36. package/build/run/utils.js +20 -0
  37. package/build/submit/ArchiveSource.d.ts +20 -10
  38. package/build/submit/ArchiveSource.js +59 -60
  39. package/build/submit/BaseSubmitter.d.ts +4 -1
  40. package/build/submit/BaseSubmitter.js +20 -0
  41. package/build/submit/android/AndroidSubmitCommand.js +1 -2
  42. package/build/submit/android/AndroidSubmitter.d.ts +3 -3
  43. package/build/submit/android/AndroidSubmitter.js +12 -7
  44. package/build/submit/commons.d.ts +1 -1
  45. package/build/submit/commons.js +1 -16
  46. package/build/submit/ios/IosSubmitCommand.js +1 -2
  47. package/build/submit/ios/IosSubmitter.d.ts +3 -3
  48. package/build/submit/ios/IosSubmitter.js +11 -6
  49. package/build/submit/utils/files.js +2 -2
  50. package/build/submit/utils/summary.d.ts +2 -2
  51. package/build/submit/utils/summary.js +7 -8
  52. package/build/uploads.d.ts +4 -10
  53. package/build/uploads.js +16 -36
  54. package/build/utils/download.d.ts +3 -2
  55. package/build/utils/download.js +60 -36
  56. package/build/utils/paths.d.ts +7 -7
  57. package/build/utils/paths.js +3 -1
  58. package/build/utils/progress.d.ts +1 -1
  59. package/build/utils/progress.js +6 -4
  60. package/oclif.manifest.json +1 -1
  61. package/package.json +3 -3
@@ -21,69 +21,74 @@ var ArchiveSourceType;
21
21
  ArchiveSourceType[ArchiveSourceType["latest"] = 1] = "latest";
22
22
  ArchiveSourceType[ArchiveSourceType["path"] = 2] = "path";
23
23
  ArchiveSourceType[ArchiveSourceType["buildId"] = 3] = "buildId";
24
- ArchiveSourceType[ArchiveSourceType["buildList"] = 4] = "buildList";
25
- ArchiveSourceType[ArchiveSourceType["prompt"] = 5] = "prompt";
24
+ ArchiveSourceType[ArchiveSourceType["build"] = 4] = "build";
25
+ ArchiveSourceType[ArchiveSourceType["buildList"] = 5] = "buildList";
26
+ ArchiveSourceType[ArchiveSourceType["prompt"] = 6] = "prompt";
27
+ ArchiveSourceType[ArchiveSourceType["gcs"] = 7] = "gcs";
26
28
  })(ArchiveSourceType = exports.ArchiveSourceType || (exports.ArchiveSourceType = {}));
27
- async function getArchiveAsync(graphqlClient, source) {
29
+ async function getArchiveAsync(ctx, source) {
28
30
  switch (source.sourceType) {
29
31
  case ArchiveSourceType.prompt: {
30
- return await handlePromptSourceAsync(graphqlClient, source);
32
+ return await handlePromptSourceAsync(ctx);
31
33
  }
32
34
  case ArchiveSourceType.url: {
33
- return await handleUrlSourceAsync(graphqlClient, source);
35
+ return await handleUrlSourceAsync(ctx, source);
34
36
  }
35
37
  case ArchiveSourceType.latest: {
36
- return await handleLatestSourceAsync(graphqlClient, source);
38
+ return await handleLatestSourceAsync(ctx);
37
39
  }
38
40
  case ArchiveSourceType.path: {
39
- return await handlePathSourceAsync(graphqlClient, source);
41
+ return await handlePathSourceAsync(ctx, source);
40
42
  }
41
43
  case ArchiveSourceType.buildId: {
42
- return await handleBuildIdSourceAsync(graphqlClient, source);
44
+ return await handleBuildIdSourceAsync(ctx, source);
43
45
  }
44
46
  case ArchiveSourceType.buildList: {
45
- return await handleBuildListSourceAsync(graphqlClient, source);
47
+ return await handleBuildListSourceAsync(ctx);
48
+ }
49
+ case ArchiveSourceType.gcs: {
50
+ return source;
51
+ }
52
+ case ArchiveSourceType.build: {
53
+ return source;
46
54
  }
47
55
  }
48
56
  }
49
57
  exports.getArchiveAsync = getArchiveAsync;
50
- async function handleUrlSourceAsync(graphqlClient, source) {
58
+ async function handleUrlSourceAsync(ctx, source) {
51
59
  const { url } = source;
52
60
  if (!validateUrl(url)) {
53
61
  log_1.default.error(chalk_1.default.bold(`The URL you provided is invalid: ${url}`));
54
- return getArchiveAsync(graphqlClient, {
55
- ...source,
62
+ return getArchiveAsync(ctx, {
56
63
  sourceType: ArchiveSourceType.prompt,
57
64
  });
58
65
  }
59
66
  const maybeBuildId = isBuildDetailsPage(url);
60
67
  if (maybeBuildId) {
61
- if (await askIfUseBuildIdFromUrlAsync(source, maybeBuildId)) {
62
- return getArchiveAsync(graphqlClient, {
63
- ...source,
68
+ if (await askIfUseBuildIdFromUrlAsync(ctx, source, maybeBuildId)) {
69
+ return getArchiveAsync(ctx, {
64
70
  sourceType: ArchiveSourceType.buildId,
65
71
  id: maybeBuildId,
66
72
  });
67
73
  }
68
74
  }
69
75
  return {
76
+ sourceType: ArchiveSourceType.url,
70
77
  url,
71
- source,
72
78
  };
73
79
  }
74
- async function handleLatestSourceAsync(graphqlClient, source) {
80
+ async function handleLatestSourceAsync(ctx) {
75
81
  try {
76
- const [latestBuild] = await (0, builds_1.getRecentBuildsForSubmissionAsync)(graphqlClient, (0, AppPlatform_1.toAppPlatform)(source.platform), source.projectId);
82
+ const [latestBuild] = await (0, builds_1.getRecentBuildsForSubmissionAsync)(ctx.graphqlClient, (0, AppPlatform_1.toAppPlatform)(ctx.platform), ctx.projectId);
77
83
  if (!latestBuild) {
78
84
  log_1.default.error(chalk_1.default.bold("Couldn't find any builds for this project on EAS servers. It looks like you haven't run 'eas build' yet."));
79
- return getArchiveAsync(graphqlClient, {
80
- ...source,
85
+ return getArchiveAsync(ctx, {
81
86
  sourceType: ArchiveSourceType.prompt,
82
87
  });
83
88
  }
84
89
  return {
90
+ sourceType: ArchiveSourceType.build,
85
91
  build: latestBuild,
86
- source,
87
92
  };
88
93
  }
89
94
  catch (err) {
@@ -91,36 +96,38 @@ async function handleLatestSourceAsync(graphqlClient, source) {
91
96
  throw err;
92
97
  }
93
98
  }
94
- async function handlePathSourceAsync(graphqlClient, source) {
99
+ async function handlePathSourceAsync(ctx, source) {
95
100
  if (!(await (0, files_1.isExistingFileAsync)(source.path))) {
96
101
  log_1.default.error(chalk_1.default.bold(`${source.path} doesn't exist`));
97
- return getArchiveAsync(graphqlClient, {
98
- ...source,
102
+ return getArchiveAsync(ctx, {
99
103
  sourceType: ArchiveSourceType.prompt,
100
104
  });
101
105
  }
102
- log_1.default.log('Uploading your app archive to the Expo Submission Service');
103
- const uploadUrl = await (0, files_1.uploadAppArchiveAsync)(graphqlClient, source.path);
106
+ log_1.default.log('Uploading your app archive to EAS Submit');
107
+ const bucketKey = await (0, files_1.uploadAppArchiveAsync)(ctx.graphqlClient, source.path);
104
108
  return {
105
- url: uploadUrl,
106
- source,
109
+ sourceType: ArchiveSourceType.gcs,
110
+ bucketKey,
111
+ localSource: {
112
+ sourceType: ArchiveSourceType.path,
113
+ path: source.path,
114
+ },
107
115
  };
108
116
  }
109
- async function handleBuildIdSourceAsync(graphqlClient, source) {
117
+ async function handleBuildIdSourceAsync(ctx, source) {
110
118
  try {
111
- const build = await BuildQuery_1.BuildQuery.byIdAsync(graphqlClient, source.id);
112
- if (build.platform !== (0, AppPlatform_1.toAppPlatform)(source.platform)) {
113
- const expectedPlatformName = platform_1.appPlatformDisplayNames[(0, AppPlatform_1.toAppPlatform)(source.platform)];
119
+ const build = await BuildQuery_1.BuildQuery.byIdAsync(ctx.graphqlClient, source.id);
120
+ if (build.platform !== (0, AppPlatform_1.toAppPlatform)(ctx.platform)) {
121
+ const expectedPlatformName = platform_1.appPlatformDisplayNames[(0, AppPlatform_1.toAppPlatform)(ctx.platform)];
114
122
  const receivedPlatformName = platform_1.appPlatformDisplayNames[build.platform];
115
123
  log_1.default.error(chalk_1.default.bold(`Build platform doesn't match! Expected ${expectedPlatformName} build but got ${receivedPlatformName}.`));
116
- return getArchiveAsync(graphqlClient, {
117
- ...source,
124
+ return getArchiveAsync(ctx, {
118
125
  sourceType: ArchiveSourceType.prompt,
119
126
  });
120
127
  }
121
128
  return {
129
+ sourceType: ArchiveSourceType.build,
122
130
  build,
123
- source,
124
131
  };
125
132
  }
126
133
  catch (err) {
@@ -128,33 +135,30 @@ async function handleBuildIdSourceAsync(graphqlClient, source) {
128
135
  log_1.default.warn('Are you sure that the given ID corresponds to a build from EAS Build?');
129
136
  log_1.default.warn(`Build IDs from the classic build service (expo build:[android|ios]) are not supported. ${(0, log_1.learnMore)('https://docs.expo.dev/submit/classic-builds/')}`);
130
137
  log_1.default.debug('Original error:', err);
131
- return getArchiveAsync(graphqlClient, {
132
- ...source,
138
+ return getArchiveAsync(ctx, {
133
139
  sourceType: ArchiveSourceType.prompt,
134
140
  });
135
141
  }
136
142
  }
137
- async function handleBuildListSourceAsync(graphqlClient, source) {
143
+ async function handleBuildListSourceAsync(ctx) {
138
144
  try {
139
- const appPlatform = (0, AppPlatform_1.toAppPlatform)(source.platform);
145
+ const appPlatform = (0, AppPlatform_1.toAppPlatform)(ctx.platform);
140
146
  const expiryDate = new Date(); // artifacts expire after 30 days
141
147
  expiryDate.setDate(expiryDate.getDate() - 30);
142
- const recentBuilds = await (0, builds_1.getRecentBuildsForSubmissionAsync)(graphqlClient, appPlatform, source.projectId, {
148
+ const recentBuilds = await (0, builds_1.getRecentBuildsForSubmissionAsync)(ctx.graphqlClient, appPlatform, ctx.projectId, {
143
149
  limit: exports.BUILD_LIST_ITEM_COUNT,
144
150
  });
145
151
  if (recentBuilds.length < 1) {
146
152
  log_1.default.error(chalk_1.default.bold(`Couldn't find any ${platform_1.appPlatformDisplayNames[appPlatform]} builds for this project on EAS servers. ` +
147
153
  "It looks like you haven't run 'eas build' yet."));
148
- return getArchiveAsync(graphqlClient, {
149
- ...source,
154
+ return getArchiveAsync(ctx, {
150
155
  sourceType: ArchiveSourceType.prompt,
151
156
  });
152
157
  }
153
158
  if (recentBuilds.every(it => new Date(it.updatedAt) < expiryDate)) {
154
159
  log_1.default.error(chalk_1.default.bold('It looks like all of your build artifacts have expired. ' +
155
160
  'EAS keeps your build artifacts only for 30 days.'));
156
- return getArchiveAsync(graphqlClient, {
157
- ...source,
161
+ return getArchiveAsync(ctx, {
158
162
  sourceType: ArchiveSourceType.prompt,
159
163
  });
160
164
  }
@@ -171,14 +175,13 @@ async function handleBuildListSourceAsync(graphqlClient, source) {
171
175
  warn: 'This artifact has expired',
172
176
  });
173
177
  if (selectedBuild == null) {
174
- return getArchiveAsync(graphqlClient, {
175
- ...source,
178
+ return getArchiveAsync(ctx, {
176
179
  sourceType: ArchiveSourceType.prompt,
177
180
  });
178
181
  }
179
182
  return {
183
+ sourceType: ArchiveSourceType.build,
180
184
  build: selectedBuild,
181
- source,
182
185
  };
183
186
  }
184
187
  catch (err) {
@@ -207,7 +210,7 @@ function formatBuildChoice(build, expiryDate) {
207
210
  disabled: buildDate < expiryDate,
208
211
  };
209
212
  }
210
- async function handlePromptSourceAsync(graphqlClient, source) {
213
+ async function handlePromptSourceAsync(ctx) {
211
214
  const { sourceType: sourceTypeRaw } = await (0, prompts_1.promptAsync)({
212
215
  name: 'sourceType',
213
216
  type: 'select',
@@ -231,31 +234,27 @@ async function handlePromptSourceAsync(graphqlClient, source) {
231
234
  const sourceType = sourceTypeRaw;
232
235
  switch (sourceType) {
233
236
  case ArchiveSourceType.url: {
234
- const url = await askForArchiveUrlAsync(source.platform);
235
- return getArchiveAsync(graphqlClient, {
236
- ...source,
237
+ const url = await askForArchiveUrlAsync(ctx.platform);
238
+ return getArchiveAsync(ctx, {
237
239
  sourceType: ArchiveSourceType.url,
238
240
  url,
239
241
  });
240
242
  }
241
243
  case ArchiveSourceType.path: {
242
- const path = await askForArchivePathAsync(source.platform);
243
- return getArchiveAsync(graphqlClient, {
244
- ...source,
244
+ const path = await askForArchivePathAsync(ctx.platform);
245
+ return getArchiveAsync(ctx, {
245
246
  sourceType: ArchiveSourceType.path,
246
247
  path,
247
248
  });
248
249
  }
249
250
  case ArchiveSourceType.buildList: {
250
- return getArchiveAsync(graphqlClient, {
251
- ...source,
251
+ return getArchiveAsync(ctx, {
252
252
  sourceType: ArchiveSourceType.buildList,
253
253
  });
254
254
  }
255
255
  case ArchiveSourceType.buildId: {
256
256
  const id = await askForBuildIdAsync();
257
- return getArchiveAsync(graphqlClient, {
258
- ...source,
257
+ return getArchiveAsync(ctx, {
259
258
  sourceType: ArchiveSourceType.buildId,
260
259
  id,
261
260
  });
@@ -325,11 +324,11 @@ async function askForBuildIdAsync() {
325
324
  });
326
325
  return id;
327
326
  }
328
- async function askIfUseBuildIdFromUrlAsync(source, buildId) {
327
+ async function askIfUseBuildIdFromUrlAsync(ctx, source, buildId) {
329
328
  const { url } = source;
330
329
  log_1.default.warn(`It seems that you provided a build details page URL: ${url}`);
331
330
  log_1.default.warn('We expected to see the build artifact URL.');
332
- if (!source.nonInteractive) {
331
+ if (!ctx.nonInteractive) {
333
332
  const useAsBuildId = await (0, prompts_1.confirmAsync)({
334
333
  message: `Do you want to submit build ${buildId} instead?`,
335
334
  });
@@ -1,11 +1,13 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { AnalyticsEvent } from '../analytics/AnalyticsManager';
3
- import { AndroidSubmissionConfigInput, IosSubmissionConfigInput, SubmissionFragment } from '../graphql/generated';
3
+ import { AndroidSubmissionConfigInput, IosSubmissionConfigInput, SubmissionArchiveSourceInput, SubmissionFragment } from '../graphql/generated';
4
+ import { ResolvedArchiveSource } from './ArchiveSource';
4
5
  import { SubmissionContext } from './context';
5
6
  export interface SubmissionInput<P extends Platform> {
6
7
  projectId: string;
7
8
  submissionConfig: P extends Platform.ANDROID ? AndroidSubmissionConfigInput : IosSubmissionConfigInput;
8
9
  buildId?: string;
10
+ archiveSource?: SubmissionArchiveSourceInput;
9
11
  }
10
12
  interface AnalyticEvents {
11
13
  attemptEvent: AnalyticsEvent;
@@ -25,6 +27,7 @@ export default abstract class BaseSubmitter<P extends Platform, ResolvedSourceOp
25
27
  private getSourceOptionsAsync;
26
28
  submitAsync(): Promise<SubmissionFragment>;
27
29
  abstract createSubmissionInputAsync(resolvedOptions: ResolvedSourceOptions): Promise<SubmissionInput<P>>;
30
+ formatArchive(archive: ResolvedArchiveSource): Pick<SubmissionInput<P>, 'archiveSource' | 'buildId'>;
28
31
  private createSubmissionAsync;
29
32
  private createSubmissionWithAnalyticsAsync;
30
33
  protected abstract createPlatformSubmissionAsync(input: SubmissionInput<P>): Promise<SubmissionFragment>;
@@ -3,10 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const AnalyticsManager_1 = require("../analytics/AnalyticsManager");
5
5
  const common_1 = require("../analytics/common");
6
+ const generated_1 = require("../graphql/generated");
6
7
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
7
8
  const log_1 = tslib_1.__importDefault(require("../log"));
8
9
  const ora_1 = require("../ora");
9
10
  const platform_1 = require("../platform");
11
+ const ArchiveSource_1 = require("./ArchiveSource");
10
12
  class BaseSubmitter {
11
13
  constructor(ctx, options, sourceOptionResolver, sourceOptionAnalytics) {
12
14
  this.ctx = ctx;
@@ -35,6 +37,24 @@ class BaseSubmitter {
35
37
  const input = await this.createSubmissionInputAsync(resolvedSourceOptions);
36
38
  return await this.createSubmissionWithAnalyticsAsync(input);
37
39
  }
40
+ formatArchive(archive) {
41
+ switch (archive.sourceType) {
42
+ case ArchiveSource_1.ArchiveSourceType.url: {
43
+ return { archiveSource: { type: generated_1.SubmissionArchiveSourceType.Url, url: archive.url } };
44
+ }
45
+ case ArchiveSource_1.ArchiveSourceType.gcs: {
46
+ return {
47
+ archiveSource: {
48
+ type: generated_1.SubmissionArchiveSourceType.GcsSubmitArchive,
49
+ bucketKey: archive.bucketKey,
50
+ },
51
+ };
52
+ }
53
+ case ArchiveSource_1.ArchiveSourceType.build: {
54
+ return { buildId: archive.build.id };
55
+ }
56
+ }
57
+ }
38
58
  async createSubmissionAsync(submissionInput) {
39
59
  log_1.default.addNewLineIfNone();
40
60
  const platformDisplayName = platform_1.appPlatformDisplayNames[(0, AppPlatform_1.toAppPlatform)(this.ctx.platform)];
@@ -1,7 +1,6 @@
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 eas_json_1 = require("@expo/eas-json");
6
5
  const results_1 = require("@expo/results");
7
6
  const generated_1 = require("../../graphql/generated");
@@ -81,7 +80,7 @@ class AndroidSubmitCommand {
81
80
  }
82
81
  resolveArchiveSource() {
83
82
  try {
84
- return (0, results_1.result)((0, commons_1.resolveArchiveSource)(this.ctx, eas_build_job_1.Platform.ANDROID));
83
+ return (0, results_1.result)((0, commons_1.resolveArchiveSource)(this.ctx));
85
84
  }
86
85
  catch (err) {
87
86
  return (0, results_1.result)(err);
@@ -1,6 +1,6 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { AndroidSubmissionConfigInput, SubmissionFragment } from '../../graphql/generated';
3
- import { Archive, ArchiveSource } from '../ArchiveSource';
3
+ import { ArchiveSource, ResolvedArchiveSource } from '../ArchiveSource';
4
4
  import BaseSubmitter, { SubmissionInput } from '../BaseSubmitter';
5
5
  import { SubmissionContext } from '../context';
6
6
  import { ServiceAccountKeyResult, ServiceAccountSource } from './ServiceAccountSource';
@@ -10,13 +10,13 @@ export interface AndroidSubmissionOptions extends Pick<AndroidSubmissionConfigIn
10
10
  serviceAccountSource: ServiceAccountSource;
11
11
  }
12
12
  interface ResolvedSourceOptions {
13
- archive: Archive;
13
+ archive: ResolvedArchiveSource;
14
14
  serviceAccountKeyResult: ServiceAccountKeyResult;
15
15
  }
16
16
  export default class AndroidSubmitter extends BaseSubmitter<Platform.ANDROID, ResolvedSourceOptions, AndroidSubmissionOptions> {
17
17
  constructor(ctx: SubmissionContext<Platform.ANDROID>, options: AndroidSubmissionOptions);
18
18
  createSubmissionInputAsync(resolvedSourceOptions: ResolvedSourceOptions): Promise<SubmissionInput<Platform.ANDROID>>;
19
- protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, }: SubmissionInput<Platform.ANDROID>): Promise<SubmissionFragment>;
19
+ protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }: SubmissionInput<Platform.ANDROID>): Promise<SubmissionFragment>;
20
20
  private formatSubmissionConfig;
21
21
  private prepareSummaryData;
22
22
  }
@@ -1,6 +1,7 @@
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 chalk_1 = tslib_1.__importDefault(require("chalk"));
5
6
  const AnalyticsManager_1 = require("../../analytics/AnalyticsManager");
6
7
  const SubmissionMutation_1 = require("../../graphql/mutations/SubmissionMutation");
@@ -13,7 +14,12 @@ class AndroidSubmitter extends BaseSubmitter_1.default {
13
14
  constructor(ctx, options) {
14
15
  const sourceOptionsResolver = {
15
16
  // eslint-disable-next-line async-protect/async-suffix
16
- archive: async () => await (0, ArchiveSource_1.getArchiveAsync)(ctx.graphqlClient, this.options.archiveSource),
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),
17
23
  // eslint-disable-next-line async-protect/async-suffix
18
24
  serviceAccountKeyResult: async () => {
19
25
  return await (0, ServiceAccountSource_1.getServiceAccountKeyResultAsync)(this.ctx, this.options.serviceAccountSource);
@@ -34,26 +40,25 @@ class AndroidSubmitter extends BaseSubmitter_1.default {
34
40
  super(ctx, options, sourceOptionsResolver, sourceOptionsAnalytics);
35
41
  }
36
42
  async createSubmissionInputAsync(resolvedSourceOptions) {
37
- var _a;
38
- const submissionConfig = await this.formatSubmissionConfig(this.options, resolvedSourceOptions);
43
+ const submissionConfig = this.formatSubmissionConfig(this.options, resolvedSourceOptions);
39
44
  (0, summary_1.printSummary)(this.prepareSummaryData(this.options, resolvedSourceOptions), SummaryHumanReadableKeys);
40
45
  return {
41
46
  projectId: this.options.projectId,
42
47
  submissionConfig,
43
- buildId: (_a = resolvedSourceOptions.archive.build) === null || _a === void 0 ? void 0 : _a.id,
48
+ ...this.formatArchive(resolvedSourceOptions.archive),
44
49
  };
45
50
  }
46
- async createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, }) {
51
+ async createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }) {
47
52
  return await SubmissionMutation_1.SubmissionMutation.createAndroidSubmissionAsync(this.ctx.graphqlClient, {
48
53
  appId: projectId,
49
54
  config: submissionConfig,
50
55
  submittedBuildId: buildId,
56
+ archiveSource,
51
57
  });
52
58
  }
53
- formatSubmissionConfig(options, { archive, serviceAccountKeyResult }) {
59
+ formatSubmissionConfig(options, { serviceAccountKeyResult }) {
54
60
  const { track, releaseStatus, changesNotSentForReview } = options;
55
61
  return {
56
- archiveUrl: archive.url,
57
62
  track,
58
63
  changesNotSentForReview,
59
64
  releaseStatus,
@@ -1,4 +1,4 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { ArchiveSource } from './ArchiveSource';
3
3
  import { SubmissionContext } from './context';
4
- export declare function resolveArchiveSource<T extends Platform>(ctx: SubmissionContext<T>, platform: T): ArchiveSource;
4
+ export declare function resolveArchiveSource<T extends Platform>(ctx: SubmissionContext<T>): ArchiveSource;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveArchiveSource = void 0;
4
4
  const ArchiveSource_1 = require("./ArchiveSource");
5
- function resolveArchiveSource(ctx, platform) {
5
+ function resolveArchiveSource(ctx) {
6
6
  const { url, path, id, latest } = ctx.archiveFlags;
7
7
  const chosenOptions = [url, path, id, latest];
8
8
  if (chosenOptions.filter(opt => opt).length > 1) {
@@ -12,18 +12,12 @@ function resolveArchiveSource(ctx, platform) {
12
12
  return {
13
13
  sourceType: ArchiveSource_1.ArchiveSourceType.url,
14
14
  url,
15
- platform,
16
- projectId: ctx.projectId,
17
- nonInteractive: ctx.nonInteractive,
18
15
  };
19
16
  }
20
17
  else if (path) {
21
18
  return {
22
19
  sourceType: ArchiveSource_1.ArchiveSourceType.path,
23
20
  path,
24
- platform,
25
- projectId: ctx.projectId,
26
- nonInteractive: ctx.nonInteractive,
27
21
  };
28
22
  }
29
23
  else if (id) {
@@ -33,17 +27,11 @@ function resolveArchiveSource(ctx, platform) {
33
27
  return {
34
28
  sourceType: ArchiveSource_1.ArchiveSourceType.buildId,
35
29
  id,
36
- platform,
37
- projectId: ctx.projectId,
38
- nonInteractive: ctx.nonInteractive,
39
30
  };
40
31
  }
41
32
  else if (latest) {
42
33
  return {
43
34
  sourceType: ArchiveSource_1.ArchiveSourceType.latest,
44
- platform,
45
- projectId: ctx.projectId,
46
- nonInteractive: ctx.nonInteractive,
47
35
  };
48
36
  }
49
37
  else if (ctx.nonInteractive) {
@@ -52,9 +40,6 @@ function resolveArchiveSource(ctx, platform) {
52
40
  else {
53
41
  return {
54
42
  sourceType: ArchiveSource_1.ArchiveSourceType.prompt,
55
- platform,
56
- projectId: ctx.projectId,
57
- nonInteractive: ctx.nonInteractive,
58
43
  };
59
44
  }
60
45
  }
@@ -1,7 +1,6 @@
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 results_1 = require("@expo/results");
6
5
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
6
  const getenv_1 = tslib_1.__importDefault(require("getenv"));
@@ -152,7 +151,7 @@ class IosSubmitCommand {
152
151
  }
153
152
  resolveArchiveSource() {
154
153
  try {
155
- return (0, results_1.result)((0, commons_1.resolveArchiveSource)(this.ctx, eas_build_job_1.Platform.IOS));
154
+ return (0, results_1.result)((0, commons_1.resolveArchiveSource)(this.ctx));
156
155
  }
157
156
  catch (err) {
158
157
  return (0, results_1.result)(err);
@@ -1,6 +1,6 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
2
  import { IosSubmissionConfigInput, SubmissionFragment } from '../../graphql/generated';
3
- import { Archive, ArchiveSource } from '../ArchiveSource';
3
+ import { ArchiveSource, ResolvedArchiveSource } from '../ArchiveSource';
4
4
  import BaseSubmitter, { SubmissionInput } from '../BaseSubmitter';
5
5
  import { SubmissionContext } from '../context';
6
6
  import { AppSpecificPasswordCredentials, AppSpecificPasswordSource } from './AppSpecificPasswordSource';
@@ -14,7 +14,7 @@ export interface IosSubmissionOptions extends Pick<IosSubmissionConfigInput, 'ap
14
14
  credentialsServiceSource?: CredentialsServiceSource;
15
15
  }
16
16
  interface ResolvedSourceOptions {
17
- archive: Archive;
17
+ archive: ResolvedArchiveSource;
18
18
  credentials: {
19
19
  appSpecificPassword?: AppSpecificPasswordCredentials;
20
20
  ascApiKeyResult?: AscApiKeyResult;
@@ -23,7 +23,7 @@ interface ResolvedSourceOptions {
23
23
  export default class IosSubmitter extends BaseSubmitter<Platform.IOS, ResolvedSourceOptions, IosSubmissionOptions> {
24
24
  constructor(ctx: SubmissionContext<Platform.IOS>, options: IosSubmissionOptions);
25
25
  createSubmissionInputAsync(resolvedSourceOptions: ResolvedSourceOptions): Promise<SubmissionInput<Platform.IOS>>;
26
- protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, }: SubmissionInput<Platform.IOS>): Promise<SubmissionFragment>;
26
+ protected createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }: SubmissionInput<Platform.IOS>): Promise<SubmissionFragment>;
27
27
  private formatSubmissionConfig;
28
28
  private formatAppSpecificPassword;
29
29
  private formatAscApiKeyResult;
@@ -1,6 +1,7 @@
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 chalk_1 = tslib_1.__importDefault(require("chalk"));
5
6
  const AnalyticsManager_1 = require("../../analytics/AnalyticsManager");
6
7
  const SubmissionMutation_1 = require("../../graphql/mutations/SubmissionMutation");
@@ -15,7 +16,12 @@ class IosSubmitter extends BaseSubmitter_1.default {
15
16
  constructor(ctx, options) {
16
17
  const sourceOptionsResolver = {
17
18
  // eslint-disable-next-line async-protect/async-suffix
18
- archive: async () => await (0, ArchiveSource_1.getArchiveAsync)(ctx.graphqlClient, this.options.archiveSource),
19
+ archive: async () => await (0, ArchiveSource_1.getArchiveAsync)({
20
+ graphqlClient: ctx.graphqlClient,
21
+ platform: eas_build_job_1.Platform.IOS,
22
+ projectId: ctx.projectId,
23
+ nonInteractive: ctx.nonInteractive,
24
+ }, this.options.archiveSource),
19
25
  // eslint-disable-next-line async-protect/async-suffix
20
26
  credentials: async () => {
21
27
  const maybeAppSpecificPassword = this.options.appSpecificPasswordSource
@@ -49,29 +55,28 @@ class IosSubmitter extends BaseSubmitter_1.default {
49
55
  super(ctx, options, sourceOptionsResolver, sourceOptionsAnalytics);
50
56
  }
51
57
  async createSubmissionInputAsync(resolvedSourceOptions) {
52
- var _a;
53
58
  const submissionConfig = this.formatSubmissionConfig(this.options, resolvedSourceOptions);
54
59
  (0, summary_1.printSummary)(this.prepareSummaryData(this.options, resolvedSourceOptions), SummaryHumanReadableKeys);
55
60
  return {
56
61
  projectId: this.options.projectId,
57
62
  submissionConfig,
58
- buildId: (_a = resolvedSourceOptions.archive.build) === null || _a === void 0 ? void 0 : _a.id,
63
+ ...this.formatArchive(resolvedSourceOptions.archive),
59
64
  };
60
65
  }
61
- async createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, }) {
66
+ async createPlatformSubmissionAsync({ projectId, submissionConfig, buildId, archiveSource, }) {
62
67
  return await SubmissionMutation_1.SubmissionMutation.createIosSubmissionAsync(this.ctx.graphqlClient, {
63
68
  appId: projectId,
64
69
  config: submissionConfig,
65
70
  submittedBuildId: buildId,
71
+ archiveSource,
66
72
  });
67
73
  }
68
- formatSubmissionConfig(options, { archive, credentials }) {
74
+ formatSubmissionConfig(options, { credentials }) {
69
75
  const { appSpecificPassword, ascApiKeyResult } = credentials;
70
76
  const { appleIdUsername, ascAppIdentifier } = options;
71
77
  return {
72
78
  ascAppIdentifier,
73
79
  appleIdUsername,
74
- archiveUrl: archive.url,
75
80
  ...(appSpecificPassword ? this.formatAppSpecificPassword(appSpecificPassword) : null),
76
81
  ...((ascApiKeyResult === null || ascApiKeyResult === void 0 ? void 0 : ascApiKeyResult.result) ? this.formatAscApiKeyResult(ascApiKeyResult.result) : null),
77
82
  };
@@ -18,11 +18,11 @@ async function isExistingFileAsync(filePath) {
18
18
  exports.isExistingFileAsync = isExistingFileAsync;
19
19
  async function uploadAppArchiveAsync(graphqlClient, path) {
20
20
  const fileSize = (await fs_extra_1.default.stat(path)).size;
21
- const { url } = await (0, uploads_1.uploadFileAtPathToS3Async)(graphqlClient, generated_1.UploadSessionType.EasSubmitAppArchive, path, (0, progress_1.createProgressTracker)({
21
+ const bucketKey = await (0, uploads_1.uploadFileAtPathToGCSAsync)(graphqlClient, generated_1.UploadSessionType.EasSubmitGcsAppArchive, path, (0, progress_1.createProgressTracker)({
22
22
  total: fileSize,
23
23
  message: 'Uploading to EAS Submit',
24
24
  completedMessage: 'Uploaded to EAS Submit',
25
25
  }));
26
- return url;
26
+ return bucketKey;
27
27
  }
28
28
  exports.uploadAppArchiveAsync = uploadAppArchiveAsync;
@@ -1,8 +1,8 @@
1
- import { Archive } from '../ArchiveSource';
1
+ import { ResolvedArchiveSource } from '../ArchiveSource';
2
2
  export interface ArchiveSourceSummaryFields {
3
3
  archiveUrl?: string;
4
4
  archivePath?: string;
5
5
  formattedBuild?: string;
6
6
  }
7
- export declare function formatArchiveSourceSummary({ source, build }: Archive): ArchiveSourceSummaryFields;
7
+ export declare function formatArchiveSourceSummary(archive: ResolvedArchiveSource): ArchiveSourceSummaryFields;
8
8
  export declare function printSummary<T extends object>(summary: T, keyMap: Record<keyof T, string>): void;
@@ -32,18 +32,17 @@ function formatSubmissionBuildSummary(build) {
32
32
  labelFormat: label => ` ${chalk_1.default.dim(label)}:`,
33
33
  }));
34
34
  }
35
- function formatArchiveSourceSummary({ source, build }) {
35
+ function formatArchiveSourceSummary(archive) {
36
36
  const summarySlice = {};
37
- switch (source.sourceType) {
38
- case ArchiveSource_1.ArchiveSourceType.path:
39
- summarySlice.archivePath = source.path;
37
+ switch (archive.sourceType) {
38
+ case ArchiveSource_1.ArchiveSourceType.gcs:
39
+ summarySlice.archivePath = archive.localSource.path;
40
40
  break;
41
41
  case ArchiveSource_1.ArchiveSourceType.url:
42
- summarySlice.archiveUrl = source.url;
42
+ summarySlice.archiveUrl = archive.url;
43
43
  break;
44
- case ArchiveSource_1.ArchiveSourceType.buildId:
45
- case ArchiveSource_1.ArchiveSourceType.latest:
46
- summarySlice.formattedBuild = formatSubmissionBuildSummary(build);
44
+ case ArchiveSource_1.ArchiveSourceType.build:
45
+ summarySlice.formattedBuild = formatSubmissionBuildSummary(archive.build);
47
46
  break;
48
47
  }
49
48
  return summarySlice;