eas-cli 5.5.0 → 5.6.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.
- package/README.md +57 -57
- package/build/commands/submit.js +1 -0
- package/build/graphql/generated.d.ts +17 -1
- package/build/graphql/generated.js +3 -1
- package/build/graphql/types/Build.js +1 -0
- package/build/submit/android/AndroidSubmitCommand.js +24 -6
- package/build/submit/android/AndroidSubmitter.d.ts +1 -1
- package/build/submit/android/AndroidSubmitter.js +2 -9
- package/build/submit/commons.d.ts +1 -0
- package/build/submit/commons.js +20 -1
- package/build/submit/context.d.ts +2 -0
- package/build/submit/ios/IosSubmitCommand.js +23 -6
- package/build/submit/ios/IosSubmitter.d.ts +1 -1
- package/build/submit/ios/IosSubmitter.js +2 -9
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
|
@@ -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
|
|
20
|
-
|
|
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,
|
|
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
|
|
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 () =>
|
|
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>>;
|
package/build/submit/commons.js
CHANGED
|
@@ -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
|
|
22
|
-
|
|
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
|
|
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 () =>
|
|
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
|