eas-cli 12.4.1 → 12.5.1

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 (68) hide show
  1. package/README.md +66 -62
  2. package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +1 -4
  3. package/build/build/evaluateConfigWithEnvVarsAsync.js +3 -6
  4. package/build/build/local.js +19 -11
  5. package/build/build/runBuildAndSubmit.d.ts +0 -2
  6. package/build/build/runBuildAndSubmit.js +0 -1
  7. package/build/commandUtils/flags.d.ts +0 -3
  8. package/build/commandUtils/flags.js +1 -15
  9. package/build/commands/build/index.d.ts +0 -2
  10. package/build/commands/build/index.js +0 -2
  11. package/build/commands/build/resign.d.ts +0 -1
  12. package/build/commands/build/resign.js +0 -2
  13. package/build/commands/build/version/get.d.ts +0 -1
  14. package/build/commands/build/version/get.js +0 -2
  15. package/build/commands/build/version/set.d.ts +0 -1
  16. package/build/commands/build/version/set.js +0 -3
  17. package/build/commands/build/version/sync.d.ts +0 -1
  18. package/build/commands/build/version/sync.js +0 -3
  19. package/build/commands/config.d.ts +0 -1
  20. package/build/commands/config.js +0 -2
  21. package/build/commands/env/exec.d.ts +23 -0
  22. package/build/commands/env/exec.js +124 -0
  23. package/build/commands/submit/internal.d.ts +24 -0
  24. package/build/commands/submit/internal.js +168 -0
  25. package/build/commands/update/republish.d.ts +2 -0
  26. package/build/commands/update/republish.js +34 -4
  27. package/build/commands/worker/deploy.js +15 -14
  28. package/build/credentials/manager/Actions.d.ts +4 -2
  29. package/build/credentials/manager/Actions.js +2 -0
  30. package/build/credentials/manager/AndroidActions.js +5 -0
  31. package/build/credentials/manager/IosActions.js +5 -0
  32. package/build/credentials/manager/ManageAndroid.js +3 -0
  33. package/build/credentials/manager/ManageIos.js +3 -0
  34. package/build/graphql/generated.d.ts +165 -32
  35. package/build/graphql/generated.js +1 -0
  36. package/build/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +8 -0
  37. package/build/graphql/queries/AppStoreConnectApiKeyQuery.js +32 -0
  38. package/build/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +6 -0
  39. package/build/graphql/queries/GoogleServiceAccountKeyQuery.js +25 -0
  40. package/build/graphql/types/Submission.js +1 -1
  41. package/build/project/android/applicationId.js +3 -3
  42. package/build/project/expoConfig.js +0 -15
  43. package/build/project/ios/bundleIdentifier.js +3 -3
  44. package/build/project/publish.js +3 -2
  45. package/build/submit/ArchiveSource.js +15 -1
  46. package/build/submit/BaseSubmitter.d.ts +1 -0
  47. package/build/submit/BaseSubmitter.js +5 -2
  48. package/build/submit/android/AndroidSubmitCommand.d.ts +2 -2
  49. package/build/submit/android/AndroidSubmitCommand.js +1 -1
  50. package/build/submit/ios/IosSubmitCommand.d.ts +2 -2
  51. package/build/submit/ios/IosSubmitCommand.js +1 -1
  52. package/build/submit/submit.js +2 -1
  53. package/build/submit/utils/builds.js +22 -10
  54. package/build/submit/utils/logs.js +16 -17
  55. package/build/update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.d.ts +5 -0
  56. package/build/update/{getBranchNameFromChannelNameAsync.js → getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.js} +8 -7
  57. package/build/update/republish.js +2 -2
  58. package/build/utils/prompts.js +3 -3
  59. package/build/worker/assets.d.ts +1 -1
  60. package/build/worker/assets.js +4 -2
  61. package/build/worker/deployment.d.ts +10 -0
  62. package/build/worker/deployment.js +38 -27
  63. package/build/worker/upload.js +4 -6
  64. package/build/worker/utils/logs.d.ts +14 -13
  65. package/build/worker/utils/logs.js +18 -18
  66. package/oclif.manifest.json +103 -79
  67. package/package.json +7 -6
  68. package/build/update/getBranchNameFromChannelNameAsync.d.ts +0 -2
@@ -98,7 +98,6 @@ async function runBuildAndSubmitAsync(graphqlClient, analytics, vcsClient, proje
98
98
  for (const buildProfile of buildProfiles) {
99
99
  const platform = (0, AppPlatform_1.toAppPlatform)(buildProfile.platform);
100
100
  const { env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
101
- flags,
102
101
  buildProfile: buildProfile.profile,
103
102
  buildProfileName: buildProfile.profileName,
104
103
  graphqlClient,
@@ -6,9 +6,6 @@ export declare const EasNonInteractiveAndJsonFlags: {
6
6
  export declare const EASEnvironmentFlag: {
7
7
  environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
8
8
  };
9
- export declare const EASEnvironmentFlagHidden: {
10
- environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
11
- };
12
9
  export declare const EASVariableFormatFlag: {
13
10
  format: import("@oclif/core/lib/interfaces").OptionFlag<string>;
14
11
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASEnvironmentFlagHidden = exports.EASEnvironmentFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
3
+ exports.EasJsonOnlyFlag = exports.EASNonInteractiveFlag = exports.EASVariableScopeFlag = exports.EASVariableVisibilityFlag = exports.EASVariableFormatFlag = exports.EASEnvironmentFlag = exports.EasNonInteractiveAndJsonFlags = void 0;
4
4
  const core_1 = require("@oclif/core");
5
5
  const generated_1 = require("../graphql/generated");
6
6
  // NOTE: not exactly true, but, provided mapToLowercase and upperCaseAsync
@@ -31,20 +31,6 @@ exports.EASEnvironmentFlag = {
31
31
  ]),
32
32
  }),
33
33
  };
34
- // NOTE: Used in build commands, should be replaced with EASEnvironmentFlag when
35
- // the feature is public
36
- exports.EASEnvironmentFlagHidden = {
37
- environment: core_1.Flags.enum({
38
- description: "Environment variable's environment",
39
- parse: upperCaseAsync,
40
- hidden: true,
41
- options: mapToLowercase([
42
- generated_1.EnvironmentVariableEnvironment.Development,
43
- generated_1.EnvironmentVariableEnvironment.Preview,
44
- generated_1.EnvironmentVariableEnvironment.Production,
45
- ]),
46
- }),
47
- };
48
34
  exports.EASVariableFormatFlag = {
49
35
  format: core_1.Flags.enum({
50
36
  description: 'Output format',
@@ -1,11 +1,9 @@
1
1
  import { ResourceClass } from '@expo/eas-json';
2
2
  import { LoggerLevel } from '@expo/logger';
3
3
  import EasCommand from '../../commandUtils/EasCommand';
4
- import { EnvironmentVariableEnvironment } from '../../graphql/generated';
5
4
  export default class Build extends EasCommand {
6
5
  static description: string;
7
6
  static flags: {
8
- environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
9
7
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
8
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
9
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
@@ -90,7 +90,6 @@ class Build extends EasCommand_1.default {
90
90
  buildLoggerLevel: flags['build-logger-level'],
91
91
  freezeCredentials: flags['freeze-credentials'],
92
92
  repack: flags.repack,
93
- environment: flags.environment,
94
93
  };
95
94
  }
96
95
  async ensurePlatformSelectedAsync(flags) {
@@ -193,7 +192,6 @@ Build.flags = {
193
192
  description: 'Use the golden dev client build repack flow as it works for onboarding',
194
193
  }),
195
194
  ...flags_1.EasNonInteractiveAndJsonFlags,
196
- ...flags_1.EASEnvironmentFlagHidden,
197
195
  };
198
196
  Build.contextDefinition = {
199
197
  ..._a.ContextOptions.LoggedIn,
@@ -29,7 +29,6 @@ interface RawBuildResignFlags {
29
29
  export default class BuildResign extends EasCommand {
30
30
  static description: string;
31
31
  static flags: {
32
- environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
33
32
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
34
33
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
35
34
  offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
@@ -54,7 +54,6 @@ class BuildResign extends EasCommand_1.default {
54
54
  const easJsonCliConfig = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor)) ?? {};
55
55
  const buildProfile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, flags.targetProfile ?? 'production');
56
56
  const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
57
- flags,
58
57
  buildProfile,
59
58
  buildProfileName: flags.targetProfile ?? 'production',
60
59
  graphqlClient,
@@ -224,7 +223,6 @@ BuildResign.flags = {
224
223
  }),
225
224
  ...pagination_1.EasPaginatedQueryFlags,
226
225
  ...flags_1.EasNonInteractiveAndJsonFlags,
227
- ...flags_1.EASEnvironmentFlagHidden,
228
226
  };
229
227
  BuildResign.contextDefinition = {
230
228
  ..._a.ContextOptions.LoggedIn,
@@ -4,7 +4,6 @@ export default class BuildVersionGetView extends EasCommand {
4
4
  static flags: {
5
5
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
6
6
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
- environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
8
7
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
8
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
9
  };
@@ -44,7 +44,6 @@ class BuildVersionGetView extends EasCommand_1.default {
44
44
  const results = {};
45
45
  for (const { profile, platform } of buildProfiles) {
46
46
  const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
47
- flags,
48
47
  buildProfile: profile,
49
48
  buildProfileName: flags.profile ?? 'production',
50
49
  graphqlClient,
@@ -104,7 +103,6 @@ BuildVersionGetView.flags = {
104
103
  description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
105
104
  helpValue: 'PROFILE_NAME',
106
105
  }),
107
- ...flags_1.EASEnvironmentFlagHidden,
108
106
  ...flags_1.EasNonInteractiveAndJsonFlags,
109
107
  };
110
108
  BuildVersionGetView.contextDefinition = {
@@ -2,7 +2,6 @@ import EasCommand from '../../../commandUtils/EasCommand';
2
2
  export default class BuildVersionSetView extends EasCommand {
3
3
  static description: string;
4
4
  static flags: {
5
- environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
6
5
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
6
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
7
  };
@@ -9,7 +9,6 @@ const core_1 = require("@oclif/core");
9
9
  const chalk_1 = tslib_1.__importDefault(require("chalk"));
10
10
  const evaluateConfigWithEnvVarsAsync_1 = require("../../../build/evaluateConfigWithEnvVarsAsync");
11
11
  const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
12
- const flags_1 = require("../../../commandUtils/flags");
13
12
  const AppVersionMutation_1 = require("../../../graphql/mutations/AppVersionMutation");
14
13
  const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
15
14
  const AppPlatform_1 = require("../../../graphql/types/AppPlatform");
@@ -32,7 +31,6 @@ class BuildVersionSetView extends EasCommand_1.default {
32
31
  await (0, remoteVersionSource_1.ensureVersionSourceIsRemoteAsync)(easJsonAccessor, { nonInteractive: false });
33
32
  const profile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, flags.profile ?? undefined);
34
33
  const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
35
- flags,
36
34
  buildProfile: profile,
37
35
  buildProfileName: flags.profile ?? 'production',
38
36
  graphqlClient,
@@ -90,7 +88,6 @@ BuildVersionSetView.flags = {
90
88
  description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
91
89
  helpValue: 'PROFILE_NAME',
92
90
  }),
93
- ...flags_1.EASEnvironmentFlagHidden,
94
91
  };
95
92
  BuildVersionSetView.contextDefinition = {
96
93
  ..._a.ContextOptions.LoggedIn,
@@ -2,7 +2,6 @@ import EasCommand from '../../../commandUtils/EasCommand';
2
2
  export default class BuildVersionSyncView extends EasCommand {
3
3
  static description: string;
4
4
  static flags: {
5
- environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../../../graphql/generated").EnvironmentVariableEnvironment | undefined>;
6
5
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
6
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
7
  };
@@ -10,7 +10,6 @@ const version_1 = require("../../../build/android/version");
10
10
  const evaluateConfigWithEnvVarsAsync_1 = require("../../../build/evaluateConfigWithEnvVarsAsync");
11
11
  const version_2 = require("../../../build/ios/version");
12
12
  const EasCommand_1 = tslib_1.__importDefault(require("../../../commandUtils/EasCommand"));
13
- const flags_1 = require("../../../commandUtils/flags");
14
13
  const AppVersionQuery_1 = require("../../../graphql/queries/AppVersionQuery");
15
14
  const AppPlatform_1 = require("../../../graphql/types/AppPlatform");
16
15
  const log_1 = tslib_1.__importDefault(require("../../../log"));
@@ -43,7 +42,6 @@ class BuildVersionSyncView extends EasCommand_1.default {
43
42
  });
44
43
  for (const profileInfo of buildProfiles) {
45
44
  const { exp, projectId, env } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
46
- flags,
47
45
  buildProfile: profileInfo.profile,
48
46
  buildProfileName: profileInfo.profileName,
49
47
  graphqlClient,
@@ -142,7 +140,6 @@ BuildVersionSyncView.flags = {
142
140
  description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
143
141
  helpValue: 'PROFILE_NAME',
144
142
  }),
145
- ...flags_1.EASEnvironmentFlagHidden,
146
143
  };
147
144
  BuildVersionSyncView.contextDefinition = {
148
145
  ..._a.ContextOptions.LoggedIn,
@@ -5,7 +5,6 @@ export default class Config extends EasCommand {
5
5
  static flags: {
6
6
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
7
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- environment: import("@oclif/core/lib/interfaces").OptionFlag<import("../graphql/generated").EnvironmentVariableEnvironment | undefined>;
9
8
  platform: import("@oclif/core/lib/interfaces").OptionFlag<Platform | undefined>;
10
9
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
10
  'eas-json-only': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -62,7 +62,6 @@ class Config extends EasCommand_1.default {
62
62
  });
63
63
  const graphqlClient = (0, createGraphqlClient_1.createGraphqlClient)(authenticationInfo);
64
64
  const { exp: appConfig } = await (0, evaluateConfigWithEnvVarsAsync_1.evaluateConfigWithEnvVarsAsync)({
65
- flags,
66
65
  buildProfile: profile,
67
66
  buildProfileName: profileName,
68
67
  graphqlClient,
@@ -101,7 +100,6 @@ Config.flags = {
101
100
  'eas-json-only': core_1.Flags.boolean({
102
101
  hidden: true,
103
102
  }),
104
- ...flags_1.EASEnvironmentFlagHidden,
105
103
  ...flags_1.EasNonInteractiveAndJsonFlags,
106
104
  };
107
105
  Config.contextDefinition = {
@@ -0,0 +1,23 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ import { EnvironmentVariableEnvironment } from '../../graphql/generated';
3
+ export default class EnvExec extends EasCommand {
4
+ static description: string;
5
+ static hidden: boolean;
6
+ static contextDefinition: {
7
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
8
+ privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
9
+ };
10
+ static flags: {
11
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ environment: import("@oclif/core/lib/interfaces").OptionFlag<EnvironmentVariableEnvironment | undefined>;
13
+ };
14
+ static args: {
15
+ name: string;
16
+ required: boolean;
17
+ description: string;
18
+ }[];
19
+ runAsync(): Promise<void>;
20
+ private sanitizeFlags;
21
+ private runCommandWithEnvVarsAsync;
22
+ private loadEnvironmentVariablesAsync;
23
+ }
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
5
+ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
6
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
7
+ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
8
+ const flags_1 = require("../../commandUtils/flags");
9
+ const EnvironmentVariablesQuery_1 = require("../../graphql/queries/EnvironmentVariablesQuery");
10
+ const log_1 = tslib_1.__importDefault(require("../../log"));
11
+ const prompts_1 = require("../../utils/prompts");
12
+ class EnvExec extends EasCommand_1.default {
13
+ async runAsync() {
14
+ const { flags, args: { BASH_COMMAND: command }, } = await this.parse(_a);
15
+ const parsedFlags = this.sanitizeFlags(flags);
16
+ const { privateProjectConfig: { projectId }, loggedIn: { graphqlClient }, } = await this.getContextAsync(_a, {
17
+ nonInteractive: parsedFlags.nonInteractive,
18
+ });
19
+ const environment = parsedFlags.environment ?? (await (0, prompts_1.promptVariableEnvironmentAsync)(parsedFlags.nonInteractive));
20
+ const environmentVariables = await this.loadEnvironmentVariablesAsync({
21
+ graphqlClient,
22
+ projectId,
23
+ environment,
24
+ });
25
+ await this.runCommandWithEnvVarsAsync({ command, environmentVariables });
26
+ }
27
+ sanitizeFlags(rawFlags) {
28
+ const environment = rawFlags.environment;
29
+ if (rawFlags['non-interactive']) {
30
+ if (!environment) {
31
+ throw new Error('You must specify an environment when running in non-interactive mode. Use the --environment flag.');
32
+ }
33
+ return {
34
+ nonInteractive: true,
35
+ environment,
36
+ };
37
+ }
38
+ return {
39
+ nonInteractive: false,
40
+ environment: rawFlags.environment,
41
+ };
42
+ }
43
+ async runCommandWithEnvVarsAsync({ command, environmentVariables, }) {
44
+ log_1.default.log(`Running command: ${chalk_1.default.bold(command)}`);
45
+ const spawnPromise = (0, spawn_async_1.default)('bash', ['-c', command], {
46
+ stdio: ['inherit', 'pipe', 'pipe'],
47
+ env: {
48
+ ...process.env,
49
+ ...environmentVariables,
50
+ },
51
+ });
52
+ const { child: { stdout, stderr }, } = spawnPromise;
53
+ if (!stdout || !stderr) {
54
+ throw new Error(`Failed to spawn ${command}`);
55
+ }
56
+ stdout.on('data', data => {
57
+ for (const line of data.toString().trim().split('\n')) {
58
+ log_1.default.log(`${chalk_1.default.gray('[stdout]')} ${line}`);
59
+ }
60
+ });
61
+ stderr.on('data', data => {
62
+ for (const line of data.toString().trim().split('\n')) {
63
+ log_1.default.warn(`${chalk_1.default.gray('[stderr]')} ${line}`);
64
+ }
65
+ });
66
+ try {
67
+ await spawnPromise;
68
+ }
69
+ catch (error) {
70
+ log_1.default.error(`❌ ${chalk_1.default.bold(command)} failed`);
71
+ throw error;
72
+ }
73
+ }
74
+ async loadEnvironmentVariablesAsync({ graphqlClient, projectId, environment, }) {
75
+ const environmentVariablesQueryResult = await EnvironmentVariablesQuery_1.EnvironmentVariablesQuery.byAppIdWithSensitiveAsync(graphqlClient, {
76
+ appId: projectId,
77
+ environment,
78
+ });
79
+ const secretEnvironmentVariables = environmentVariablesQueryResult.filter(({ value }) => !value);
80
+ if (secretEnvironmentVariables.length > 0) {
81
+ log_1.default.warn(`The following environment variables are secret and cannot be downloaded locally:`);
82
+ for (const { name } of secretEnvironmentVariables) {
83
+ log_1.default.warn(`- ${name}`);
84
+ }
85
+ log_1.default.warn('Proceeding with the rest of the environment variables.');
86
+ log_1.default.newLine();
87
+ }
88
+ const nonSecretEnvironmentVariables = environmentVariablesQueryResult.filter(({ value }) => !!value);
89
+ if (nonSecretEnvironmentVariables.length === 0) {
90
+ throw new Error('No readable environment variables found for the selected environment.');
91
+ }
92
+ log_1.default.log(`Loaded environment variables for the selected environment "${environment.toLowerCase()}":`);
93
+ for (const { name } of nonSecretEnvironmentVariables) {
94
+ log_1.default.log(`- ${name}`);
95
+ }
96
+ log_1.default.newLine();
97
+ const environmentVariables = {};
98
+ for (const { name, value } of nonSecretEnvironmentVariables) {
99
+ if (value) {
100
+ environmentVariables[name] = value;
101
+ }
102
+ }
103
+ return environmentVariables;
104
+ }
105
+ }
106
+ _a = EnvExec;
107
+ EnvExec.description = 'execute a bash command with environment variables from the selected environment';
108
+ EnvExec.hidden = true;
109
+ EnvExec.contextDefinition = {
110
+ ..._a.ContextOptions.ProjectConfig,
111
+ ..._a.ContextOptions.LoggedIn,
112
+ };
113
+ EnvExec.flags = {
114
+ ...flags_1.EASEnvironmentFlag,
115
+ ...flags_1.EASNonInteractiveFlag,
116
+ };
117
+ EnvExec.args = [
118
+ {
119
+ name: 'BASH_COMMAND',
120
+ required: true,
121
+ description: 'bash command to execute with the environment variables from the environment',
122
+ },
123
+ ];
124
+ exports.default = EnvExec;
@@ -0,0 +1,24 @@
1
+ import { Platform } from '@expo/eas-build-job';
2
+ import EasCommand from '../../commandUtils/EasCommand';
3
+ /**
4
+ * This command will be run on the EAS workers.
5
+ * This command resolves credentials and other
6
+ * configuration, that normally would be included in the
7
+ * job and metadata objects, and prints them to stdout.
8
+ */
9
+ export default class SubmitInternal extends EasCommand {
10
+ static hidden: boolean;
11
+ static flags: {
12
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<Platform>;
13
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
+ id: import("@oclif/core/lib/interfaces").OptionFlag<string>;
15
+ };
16
+ static contextDefinition: {
17
+ vcsClient: import("../../commandUtils/context/VcsClientContextField").default;
18
+ analytics: import("../../commandUtils/context/AnalyticsContextField").default;
19
+ projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
20
+ loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
21
+ privateProjectConfig: import("../../commandUtils/context/PrivateProjectConfigContextField").PrivateProjectConfigContextField;
22
+ };
23
+ runAsync(): Promise<void>;
24
+ }
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ var _a;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
6
+ const eas_json_1 = require("@expo/eas-json");
7
+ const core_1 = require("@oclif/core");
8
+ const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
9
+ const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
10
+ const generated_1 = require("../../graphql/generated");
11
+ const AppStoreConnectApiKeyQuery_1 = require("../../graphql/queries/AppStoreConnectApiKeyQuery");
12
+ const GoogleServiceAccountKeyQuery_1 = require("../../graphql/queries/GoogleServiceAccountKeyQuery");
13
+ const AndroidSubmitCommand_1 = tslib_1.__importDefault(require("../../submit/android/AndroidSubmitCommand"));
14
+ const context_1 = require("../../submit/context");
15
+ const IosSubmitCommand_1 = tslib_1.__importDefault(require("../../submit/ios/IosSubmitCommand"));
16
+ const json_1 = require("../../utils/json");
17
+ const gitNoCommit_1 = tslib_1.__importDefault(require("../../vcs/clients/gitNoCommit"));
18
+ /**
19
+ * This command will be run on the EAS workers.
20
+ * This command resolves credentials and other
21
+ * configuration, that normally would be included in the
22
+ * job and metadata objects, and prints them to stdout.
23
+ */
24
+ class SubmitInternal extends EasCommand_1.default {
25
+ async runAsync() {
26
+ const { flags } = await this.parse(_a);
27
+ // This command is always run with implicit --non-interactive and --json options
28
+ (0, json_1.enableJsonOutput)();
29
+ const { loggedIn: { actor, graphqlClient }, privateProjectConfig: { exp, projectId, projectDir }, analytics, vcsClient, } = await this.getContextAsync(_a, {
30
+ nonInteractive: true,
31
+ vcsClientOverride: new gitNoCommit_1.default(),
32
+ });
33
+ const submissionProfile = await eas_json_1.EasJsonUtils.getSubmitProfileAsync(eas_json_1.EasJsonAccessor.fromProjectPath(projectDir), flags.platform, flags.profile);
34
+ const ctx = await (0, context_1.createSubmissionContextAsync)({
35
+ platform: flags.platform,
36
+ projectDir,
37
+ profile: submissionProfile,
38
+ archiveFlags: {
39
+ id: flags.id,
40
+ },
41
+ nonInteractive: true,
42
+ isVerboseFastlaneEnabled: false,
43
+ actor,
44
+ graphqlClient,
45
+ analytics,
46
+ exp,
47
+ projectId,
48
+ vcsClient,
49
+ specifiedProfile: flags.profile,
50
+ });
51
+ let config;
52
+ if (ctx.platform === eas_build_job_1.Platform.IOS) {
53
+ const command = new IosSubmitCommand_1.default(ctx);
54
+ const submitter = await command.runAsync();
55
+ const mutationInput = await submitter.getSubmissionInputAsync();
56
+ const iosConfig = mutationInput.submissionConfig;
57
+ const ascApiKeyJson = await getAppStoreConnectApiKeyJsonAsync({
58
+ iosConfig,
59
+ graphqlClient,
60
+ });
61
+ const configInput = {
62
+ ascAppIdentifier: iosConfig.ascAppIdentifier,
63
+ isVerboseFastlaneEnabled: iosConfig.isVerboseFastlaneEnabled ?? undefined,
64
+ ...(ascApiKeyJson
65
+ ? { ascApiJsonKey: ascApiKeyJson }
66
+ : {
67
+ appleIdUsername: (0, nullthrows_1.default)(iosConfig.appleIdUsername),
68
+ appleAppSpecificPassword: (0, nullthrows_1.default)(iosConfig.appleAppSpecificPassword),
69
+ }),
70
+ };
71
+ config = eas_build_job_1.SubmissionConfig.Ios.SchemaZ.parse(configInput);
72
+ }
73
+ else if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
74
+ const command = new AndroidSubmitCommand_1.default(ctx);
75
+ const submitter = await command.runAsync();
76
+ const mutationInput = await submitter.getSubmissionInputAsync();
77
+ const androidConfig = mutationInput.submissionConfig;
78
+ const changesNotSentForReview = androidConfig.changesNotSentForReview ?? undefined;
79
+ const releaseStatus = androidConfig.releaseStatus
80
+ ? graphQlReleaseStatusToConfigReleaseStatus[androidConfig.releaseStatus]
81
+ : undefined;
82
+ const googleServiceAccountKeyJson = (0, nullthrows_1.default)(await getGoogleServiceAccountKeyJsonAsync({
83
+ androidConfig,
84
+ graphqlClient,
85
+ }));
86
+ const track = graphQlTrackToConfigTrack[androidConfig.track];
87
+ const configInput = {
88
+ changesNotSentForReview,
89
+ googleServiceAccountKeyJson,
90
+ track,
91
+ ...(releaseStatus === eas_build_job_1.SubmissionConfig.Android.ReleaseStatus.IN_PROGRESS
92
+ ? {
93
+ releaseStatus: eas_build_job_1.SubmissionConfig.Android.ReleaseStatus.IN_PROGRESS,
94
+ rollout: androidConfig.rollout ?? undefined,
95
+ }
96
+ : { releaseStatus }),
97
+ };
98
+ config = eas_build_job_1.SubmissionConfig.Android.SchemaZ.parse(configInput);
99
+ }
100
+ else {
101
+ throw new Error(`Unsupported platform: ${ctx.platform}`);
102
+ }
103
+ (0, json_1.printJsonOnlyOutput)({ config });
104
+ }
105
+ }
106
+ _a = SubmitInternal;
107
+ SubmitInternal.hidden = true;
108
+ SubmitInternal.flags = {
109
+ platform: core_1.Flags.enum({
110
+ options: [eas_build_job_1.Platform.ANDROID, eas_build_job_1.Platform.IOS],
111
+ required: true,
112
+ }),
113
+ profile: core_1.Flags.string({
114
+ description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
115
+ }),
116
+ id: core_1.Flags.string({
117
+ description: 'ID of the build to submit',
118
+ required: true,
119
+ }),
120
+ };
121
+ SubmitInternal.contextDefinition = {
122
+ ..._a.ContextOptions.LoggedIn,
123
+ ..._a.ContextOptions.ProjectConfig,
124
+ ..._a.ContextOptions.ProjectDir,
125
+ ..._a.ContextOptions.Analytics,
126
+ ..._a.ContextOptions.Vcs,
127
+ };
128
+ exports.default = SubmitInternal;
129
+ async function getGoogleServiceAccountKeyJsonAsync({ androidConfig, graphqlClient, }) {
130
+ if (androidConfig.googleServiceAccountKeyJson) {
131
+ return androidConfig.googleServiceAccountKeyJson;
132
+ }
133
+ else if (androidConfig.googleServiceAccountKeyId) {
134
+ const key = await GoogleServiceAccountKeyQuery_1.GoogleServiceAccountKeyQuery.getByIdAsync(graphqlClient, androidConfig.googleServiceAccountKeyId);
135
+ return key.keyJson;
136
+ }
137
+ return null;
138
+ }
139
+ async function getAppStoreConnectApiKeyJsonAsync({ iosConfig, graphqlClient, }) {
140
+ if (iosConfig.ascApiKey) {
141
+ return JSON.stringify({
142
+ key_id: iosConfig.ascApiKey.keyIdentifier,
143
+ issuer_id: iosConfig.ascApiKey.issuerIdentifier,
144
+ key: iosConfig.ascApiKey.keyP8,
145
+ });
146
+ }
147
+ else if (iosConfig.ascApiKeyId) {
148
+ const key = await AppStoreConnectApiKeyQuery_1.AppStoreConnectApiKeyQuery.getByIdAsync(graphqlClient, iosConfig.ascApiKeyId);
149
+ return JSON.stringify({
150
+ key_id: key.keyIdentifier,
151
+ issuer_id: key.issuerIdentifier,
152
+ key: key.keyP8,
153
+ });
154
+ }
155
+ return null;
156
+ }
157
+ const graphQlReleaseStatusToConfigReleaseStatus = {
158
+ [generated_1.SubmissionAndroidReleaseStatus.Draft]: eas_build_job_1.SubmissionConfig.Android.ReleaseStatus.DRAFT,
159
+ [generated_1.SubmissionAndroidReleaseStatus.InProgress]: eas_build_job_1.SubmissionConfig.Android.ReleaseStatus.IN_PROGRESS,
160
+ [generated_1.SubmissionAndroidReleaseStatus.Completed]: eas_build_job_1.SubmissionConfig.Android.ReleaseStatus.COMPLETED,
161
+ [generated_1.SubmissionAndroidReleaseStatus.Halted]: eas_build_job_1.SubmissionConfig.Android.ReleaseStatus.HALTED,
162
+ };
163
+ const graphQlTrackToConfigTrack = {
164
+ [generated_1.SubmissionAndroidTrack.Production]: eas_build_job_1.SubmissionConfig.Android.ReleaseTrack.PRODUCTION,
165
+ [generated_1.SubmissionAndroidTrack.Beta]: eas_build_job_1.SubmissionConfig.Android.ReleaseTrack.BETA,
166
+ [generated_1.SubmissionAndroidTrack.Alpha]: eas_build_job_1.SubmissionConfig.Android.ReleaseTrack.ALPHA,
167
+ [generated_1.SubmissionAndroidTrack.Internal]: eas_build_job_1.SubmissionConfig.Android.ReleaseTrack.INTERNAL,
168
+ };
@@ -7,6 +7,8 @@ export default class UpdateRepublish extends EasCommand {
7
7
  channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
8
8
  branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
9
9
  group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ 'destination-channel': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
+ 'destination-branch': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
12
  message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
11
13
  platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
12
14
  'private-key-path': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;