eas-cli 3.0.0 → 3.1.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 +6 -1233
- package/build/branch/queries.d.ts +2 -1
- package/build/build/ios/credentials.d.ts +3 -0
- package/build/build/ios/credentials.js +16 -1
- package/build/build/ios/graphql.d.ts +4 -1
- package/build/build/ios/graphql.js +2 -1
- package/build/build/ios/prepareJob.d.ts +2 -0
- package/build/build/ios/prepareJob.js +17 -1
- package/build/build/queries.d.ts +6 -0
- package/build/build/queries.js +25 -1
- package/build/channel/errors.d.ts +3 -0
- package/build/channel/errors.js +9 -0
- package/build/channel/queries.js +1 -1
- package/build/commands/branch/delete.js +1 -1
- package/build/commands/branch/view.js +3 -1
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +2 -0
- package/build/commands/build/resign.d.ts +55 -0
- package/build/commands/build/resign.js +207 -0
- package/build/commands/channel/edit.js +1 -1
- package/build/commands/update/configure.js +15 -2
- package/build/commands/update/index.d.ts +1 -0
- package/build/commands/update/index.js +22 -7
- package/build/commands/update/list.js +3 -1
- package/build/devices/queries.js +8 -4
- package/build/graphql/generated.d.ts +136 -5
- package/build/graphql/generated.js +9 -2
- package/build/graphql/mutations/BuildMutation.d.ts +5 -1
- package/build/graphql/mutations/BuildMutation.js +17 -0
- package/build/graphql/queries/ChannelQuery.js +2 -1
- package/build/update/configure.d.ts +1 -1
- package/build/update/configure.js +52 -5
- package/build/update/getBranchNameFromChannelNameAsync.d.ts +2 -0
- package/build/update/getBranchNameFromChannelNameAsync.js +45 -0
- package/build/update/queries.js +3 -1
- package/build/utils/queries.d.ts +5 -1
- package/build/utils/queries.js +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +2 -2
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
|
3
3
|
import { CreateUpdateBranchForAppMutationVariables, UpdateBranch, UpdateBranchFragment } from '../graphql/generated';
|
|
4
|
+
import { SelectPromptEntry } from '../utils/queries';
|
|
4
5
|
export declare const BRANCHES_LIMIT = 50;
|
|
5
6
|
export declare function selectBranchOnAppAsync(graphqlClient: ExpoGraphqlClient, { projectId, promptTitle, displayTextForListItem, paginatedQueryOptions, }: {
|
|
6
7
|
projectId: string;
|
|
7
|
-
displayTextForListItem: (queryItem: UpdateBranchFragment) =>
|
|
8
|
+
displayTextForListItem: (queryItem: UpdateBranchFragment) => SelectPromptEntry;
|
|
8
9
|
promptTitle: string;
|
|
9
10
|
paginatedQueryOptions: PaginatedQueryOptions;
|
|
10
11
|
}): Promise<UpdateBranchFragment>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { Platform } from '@expo/eas-build-job';
|
|
2
|
+
import { BuildProfile } from '@expo/eas-json';
|
|
3
|
+
import { CredentialsContext } from '../../credentials/context';
|
|
2
4
|
import { IosCredentials, Target } from '../../credentials/ios/types';
|
|
3
5
|
import { CredentialsResult } from '../build';
|
|
4
6
|
import { BuildContext } from '../context';
|
|
5
7
|
export declare function ensureIosCredentialsAsync(buildCtx: BuildContext<Platform.IOS>, targets: Target[]): Promise<CredentialsResult<IosCredentials> | undefined>;
|
|
8
|
+
export declare function ensureIosCredentialsForBuildResignAsync(credentialsCtx: CredentialsContext, targets: Target[], buildProfile: BuildProfile<Platform.IOS>): Promise<CredentialsResult<IosCredentials>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureIosCredentialsAsync = void 0;
|
|
3
|
+
exports.ensureIosCredentialsForBuildResignAsync = exports.ensureIosCredentialsAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
6
|
const IosCredentialsProvider_1 = tslib_1.__importDefault(require("../../credentials/ios/IosCredentialsProvider"));
|
|
@@ -25,6 +25,21 @@ async function ensureIosCredentialsAsync(buildCtx, targets) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
exports.ensureIosCredentialsAsync = ensureIosCredentialsAsync;
|
|
28
|
+
async function ensureIosCredentialsForBuildResignAsync(credentialsCtx, targets, buildProfile) {
|
|
29
|
+
const provider = new IosCredentialsProvider_1.default(credentialsCtx, {
|
|
30
|
+
app: await (0, BuildCredentialsUtils_1.getAppFromContextAsync)(credentialsCtx),
|
|
31
|
+
targets,
|
|
32
|
+
distribution: 'internal',
|
|
33
|
+
enterpriseProvisioning: buildProfile.enterpriseProvisioning,
|
|
34
|
+
});
|
|
35
|
+
const { credentialsSource } = buildProfile;
|
|
36
|
+
(0, credentials_1.logCredentialsSource)(credentialsSource, eas_build_job_1.Platform.IOS);
|
|
37
|
+
return {
|
|
38
|
+
credentials: await provider.getCredentialsAsync(credentialsSource),
|
|
39
|
+
source: credentialsSource,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
exports.ensureIosCredentialsForBuildResignAsync = ensureIosCredentialsForBuildResignAsync;
|
|
28
43
|
function shouldProvideCredentials(buildCtx) {
|
|
29
44
|
return !buildCtx.buildProfile.simulator;
|
|
30
45
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { Ios } from '@expo/eas-build-job';
|
|
2
|
-
import { IosJobInput } from '../../graphql/generated';
|
|
2
|
+
import { IosJobInput, IosJobSecretsInput } from '../../graphql/generated';
|
|
3
3
|
export declare function transformJob(job: Ios.Job): IosJobInput;
|
|
4
|
+
export declare function transformIosSecrets(secrets: {
|
|
5
|
+
buildCredentials?: Ios.BuildCredentials;
|
|
6
|
+
}): IosJobSecretsInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.transformJob = void 0;
|
|
3
|
+
exports.transformIosSecrets = exports.transformJob = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
6
|
const graphql_1 = require("../graphql");
|
|
@@ -43,3 +43,4 @@ function transformIosSecrets(secrets) {
|
|
|
43
43
|
buildCredentials,
|
|
44
44
|
};
|
|
45
45
|
}
|
|
46
|
+
exports.transformIosSecrets = transformIosSecrets;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ArchiveSource, Job, Platform } from '@expo/eas-build-job';
|
|
2
2
|
import { IosCredentials } from '../../credentials/ios/types';
|
|
3
|
+
import { IosJobSecretsInput } from '../../graphql/generated';
|
|
3
4
|
import { BuildContext } from '../context';
|
|
4
5
|
interface JobData {
|
|
5
6
|
projectArchive: ArchiveSource;
|
|
@@ -7,4 +8,5 @@ interface JobData {
|
|
|
7
8
|
buildScheme: string;
|
|
8
9
|
}
|
|
9
10
|
export declare function prepareJobAsync(ctx: BuildContext<Platform.IOS>, jobData: JobData): Promise<Job>;
|
|
11
|
+
export declare function prepareCredentialsToResign(credentials: IosCredentials): IosJobSecretsInput;
|
|
10
12
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.prepareJobAsync = void 0;
|
|
3
|
+
exports.prepareCredentialsToResign = exports.prepareJobAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
7
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
8
|
const slash_1 = tslib_1.__importDefault(require("slash"));
|
|
8
9
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
@@ -67,6 +68,21 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
67
68
|
return (0, eas_build_job_1.sanitizeJob)(job);
|
|
68
69
|
}
|
|
69
70
|
exports.prepareJobAsync = prepareJobAsync;
|
|
71
|
+
function prepareCredentialsToResign(credentials) {
|
|
72
|
+
const buildCredentials = [];
|
|
73
|
+
for (const targetName of Object.keys(credentials !== null && credentials !== void 0 ? credentials : {})) {
|
|
74
|
+
buildCredentials.push({
|
|
75
|
+
targetName,
|
|
76
|
+
provisioningProfileBase64: (0, nullthrows_1.default)(credentials === null || credentials === void 0 ? void 0 : credentials[targetName].provisioningProfile),
|
|
77
|
+
distributionCertificate: {
|
|
78
|
+
dataBase64: (0, nullthrows_1.default)(credentials === null || credentials === void 0 ? void 0 : credentials[targetName].distributionCertificate.certificateP12),
|
|
79
|
+
password: (0, nullthrows_1.default)(credentials === null || credentials === void 0 ? void 0 : credentials[targetName].distributionCertificate.certificatePassword),
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return { buildCredentials };
|
|
84
|
+
}
|
|
85
|
+
exports.prepareCredentialsToResign = prepareCredentialsToResign;
|
|
70
86
|
function prepareTargetCredentials(targetCredentials) {
|
|
71
87
|
return {
|
|
72
88
|
provisioningProfileBase64: targetCredentials.provisioningProfile,
|
package/build/build/queries.d.ts
CHANGED
|
@@ -8,6 +8,12 @@ export declare function listAndRenderBuildsOnAppAsync(graphqlClient: ExpoGraphql
|
|
|
8
8
|
filter?: BuildFilter;
|
|
9
9
|
paginatedQueryOptions: PaginatedQueryOptions;
|
|
10
10
|
}): Promise<void>;
|
|
11
|
+
export declare function listAndSelectBuildOnAppAsync(graphqlClient: ExpoGraphqlClient, { projectId, title, filter, paginatedQueryOptions, }: {
|
|
12
|
+
projectId: string;
|
|
13
|
+
title: string;
|
|
14
|
+
filter?: BuildFilter;
|
|
15
|
+
paginatedQueryOptions: PaginatedQueryOptions;
|
|
16
|
+
}): Promise<BuildFragment | void>;
|
|
11
17
|
export declare function listAndSelectBuildsOnAppAsync(graphqlClient: ExpoGraphqlClient, selectedPlatform: AppPlatform, { projectId, projectDisplayName, filter, queryOptions, selectPromptDisabledFunction, warningMessage, }: {
|
|
12
18
|
projectId: string;
|
|
13
19
|
projectDisplayName: string;
|
package/build/build/queries.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getLatestBuildAsync = exports.listAndSelectBuildsOnAppAsync = exports.listAndRenderBuildsOnAppAsync = exports.BUILDS_LIMIT = void 0;
|
|
3
|
+
exports.getLatestBuildAsync = exports.listAndSelectBuildsOnAppAsync = exports.listAndSelectBuildOnAppAsync = exports.listAndRenderBuildsOnAppAsync = exports.BUILDS_LIMIT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const generated_1 = require("../graphql/generated");
|
|
@@ -41,6 +41,30 @@ async function listAndRenderBuildsOnAppAsync(graphqlClient, { projectId, project
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
exports.listAndRenderBuildsOnAppAsync = listAndRenderBuildsOnAppAsync;
|
|
44
|
+
async function listAndSelectBuildOnAppAsync(graphqlClient, { projectId, title, filter, paginatedQueryOptions, }) {
|
|
45
|
+
var _a;
|
|
46
|
+
if (paginatedQueryOptions.nonInteractive) {
|
|
47
|
+
throw new Error('Unable to select a build in non-interactive mode.');
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
return await (0, queries_1.paginatedQueryWithSelectPromptAsync)({
|
|
51
|
+
limit: (_a = paginatedQueryOptions.limit) !== null && _a !== void 0 ? _a : exports.BUILDS_LIMIT,
|
|
52
|
+
offset: paginatedQueryOptions.offset,
|
|
53
|
+
queryToPerform: (limit, offset) => BuildQuery_1.BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
|
|
54
|
+
appId: projectId,
|
|
55
|
+
limit,
|
|
56
|
+
offset,
|
|
57
|
+
filter,
|
|
58
|
+
}),
|
|
59
|
+
promptOptions: {
|
|
60
|
+
title,
|
|
61
|
+
getIdentifierForQueryItem: build => build.id,
|
|
62
|
+
createDisplayTextForSelectionPromptListItem: formatBuildChoiceTitleAndDescription,
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.listAndSelectBuildOnAppAsync = listAndSelectBuildOnAppAsync;
|
|
44
68
|
function formatBuildChoiceValue(value) {
|
|
45
69
|
return value ? chalk_1.default.bold(value) : chalk_1.default.dim('Unknown');
|
|
46
70
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChannelNotFoundError = void 0;
|
|
4
|
+
class ChannelNotFoundError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message !== null && message !== void 0 ? message : 'Channel not found.');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.ChannelNotFoundError = ChannelNotFoundError;
|
package/build/channel/queries.js
CHANGED
|
@@ -24,7 +24,7 @@ async function selectChannelOnAppAsync(graphqlClient, { projectId, selectionProm
|
|
|
24
24
|
queryToPerform: (limit, offset) => queryChannelsOnAppAsync(graphqlClient, { appId: projectId, limit, offset }),
|
|
25
25
|
promptOptions: {
|
|
26
26
|
title: selectionPromptTitle,
|
|
27
|
-
createDisplayTextForSelectionPromptListItem: updateChannel => updateChannel.name,
|
|
27
|
+
createDisplayTextForSelectionPromptListItem: updateChannel => ({ title: updateChannel.name }),
|
|
28
28
|
getIdentifierForQueryItem: updateChannel => updateChannel.id,
|
|
29
29
|
},
|
|
30
30
|
});
|
|
@@ -68,7 +68,7 @@ class BranchDelete extends EasCommand_1.default {
|
|
|
68
68
|
}
|
|
69
69
|
({ name: branchName } = await (0, queries_1.selectBranchOnAppAsync)(graphqlClient, {
|
|
70
70
|
projectId,
|
|
71
|
-
displayTextForListItem: updateBranch => updateBranch.name,
|
|
71
|
+
displayTextForListItem: updateBranch => ({ title: updateBranch.name }),
|
|
72
72
|
promptTitle: 'Which branch would you like to delete?',
|
|
73
73
|
paginatedQueryOptions,
|
|
74
74
|
}));
|
|
@@ -26,7 +26,9 @@ class BranchView extends EasCommand_1.default {
|
|
|
26
26
|
({ name: branchName } = await (0, queries_1.selectBranchOnAppAsync)(graphqlClient, {
|
|
27
27
|
projectId,
|
|
28
28
|
promptTitle: 'Which branch would you like to view?',
|
|
29
|
-
displayTextForListItem: updateBranch =>
|
|
29
|
+
displayTextForListItem: updateBranch => ({
|
|
30
|
+
title: updateBranch.name,
|
|
31
|
+
}),
|
|
30
32
|
// discard limit and offset because this query is not their intended target
|
|
31
33
|
paginatedQueryOptions: {
|
|
32
34
|
json: paginatedQueryOptions.json,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.handleDeprecatedEasJsonAsync = void 0;
|
|
4
5
|
const tslib_1 = require("tslib");
|
|
5
6
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
7
|
const eas_json_1 = require("@expo/eas-json");
|
|
@@ -233,3 +234,4 @@ async function handleDeprecatedEasJsonAsync(projectDir, nonInteractive) {
|
|
|
233
234
|
await easJsonAccessor.writeAsync();
|
|
234
235
|
log_1.default.withTick('Updated eas.json');
|
|
235
236
|
}
|
|
237
|
+
exports.handleDeprecatedEasJsonAsync = handleDeprecatedEasJsonAsync;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Platform } from '@expo/eas-build-job';
|
|
2
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
3
|
+
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
4
|
+
import { BuildFragment } from '../../graphql/generated';
|
|
5
|
+
interface BuildResignFlags {
|
|
6
|
+
json: boolean;
|
|
7
|
+
nonInteractive: boolean;
|
|
8
|
+
offset?: number;
|
|
9
|
+
limit?: number;
|
|
10
|
+
platform?: Platform;
|
|
11
|
+
profile?: string;
|
|
12
|
+
maybeBuildId?: string;
|
|
13
|
+
wait: boolean;
|
|
14
|
+
}
|
|
15
|
+
interface RawBuildResignFlags {
|
|
16
|
+
json: boolean;
|
|
17
|
+
'non-interactive': boolean;
|
|
18
|
+
offset: number | undefined;
|
|
19
|
+
limit: number | undefined;
|
|
20
|
+
platform: 'android' | 'ios' | undefined;
|
|
21
|
+
profile: string | undefined;
|
|
22
|
+
wait: boolean;
|
|
23
|
+
id: string | undefined;
|
|
24
|
+
}
|
|
25
|
+
export default class BuildResign extends EasCommand {
|
|
26
|
+
static description: string;
|
|
27
|
+
static flags: {
|
|
28
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
29
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
30
|
+
offset: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
31
|
+
limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
|
|
32
|
+
platform: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
33
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
34
|
+
wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
35
|
+
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
36
|
+
};
|
|
37
|
+
static contextDefinition: {
|
|
38
|
+
analytics: import("../../commandUtils/context/AnalyticsContextField").default;
|
|
39
|
+
projectDir: import("../../commandUtils/context/ProjectDirContextField").default;
|
|
40
|
+
getDynamicProjectConfigAsync: import("../../commandUtils/context/DynamicProjectConfigContextField").DynamicProjectConfigContextField;
|
|
41
|
+
loggedIn: import("../../commandUtils/context/LoggedInContextField").default;
|
|
42
|
+
};
|
|
43
|
+
runAsync(): Promise<void>;
|
|
44
|
+
sanitizeFlags(flags: RawBuildResignFlags): BuildResignFlags;
|
|
45
|
+
ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, }: {
|
|
46
|
+
graphqlClient: ExpoGraphqlClient;
|
|
47
|
+
projectId: string;
|
|
48
|
+
platform: Platform;
|
|
49
|
+
nonInteractive: boolean;
|
|
50
|
+
limit?: number;
|
|
51
|
+
offset?: number;
|
|
52
|
+
}, maybeBuild?: BuildFragment): Promise<BuildFragment>;
|
|
53
|
+
maybeGetBuildAsync(graphqlClient: ExpoGraphqlClient, maybeBuildId?: string, maybePlatform?: Platform): Promise<BuildFragment | undefined>;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1,207 @@
|
|
|
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 assert_1 = tslib_1.__importDefault(require("assert"));
|
|
9
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
10
|
+
const _1 = require(".");
|
|
11
|
+
const build_1 = require("../../build/build");
|
|
12
|
+
const credentials_1 = require("../../build/ios/credentials");
|
|
13
|
+
const prepareJob_1 = require("../../build/ios/prepareJob");
|
|
14
|
+
const queries_1 = require("../../build/queries");
|
|
15
|
+
const printBuildInfo_1 = require("../../build/utils/printBuildInfo");
|
|
16
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
17
|
+
const flags_1 = require("../../commandUtils/flags");
|
|
18
|
+
const pagination_1 = require("../../commandUtils/pagination");
|
|
19
|
+
const context_1 = require("../../credentials/context");
|
|
20
|
+
const generated_1 = require("../../graphql/generated");
|
|
21
|
+
const BuildMutation_1 = require("../../graphql/mutations/BuildMutation");
|
|
22
|
+
const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
|
|
23
|
+
const AppPlatform_1 = require("../../graphql/types/AppPlatform");
|
|
24
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
25
|
+
const platform_1 = require("../../platform");
|
|
26
|
+
const scheme_1 = require("../../project/ios/scheme");
|
|
27
|
+
const target_1 = require("../../project/ios/target");
|
|
28
|
+
const projectUtils_1 = require("../../project/projectUtils");
|
|
29
|
+
const json_1 = require("../../utils/json");
|
|
30
|
+
const statuspageService_1 = require("../../utils/statuspageService");
|
|
31
|
+
class BuildResign extends EasCommand_1.default {
|
|
32
|
+
async runAsync() {
|
|
33
|
+
var _b, _c, _d, _e, _f;
|
|
34
|
+
const { flags: rawFlags } = await this.parse(BuildResign);
|
|
35
|
+
if (rawFlags.json) {
|
|
36
|
+
(0, json_1.enableJsonOutput)();
|
|
37
|
+
}
|
|
38
|
+
const flags = this.sanitizeFlags(rawFlags);
|
|
39
|
+
const { limit, offset, nonInteractive } = flags;
|
|
40
|
+
const { loggedIn: { actor, graphqlClient }, getDynamicProjectConfigAsync, projectDir, analytics, } = await this.getContextAsync(BuildResign, {
|
|
41
|
+
nonInteractive: flags.nonInteractive,
|
|
42
|
+
});
|
|
43
|
+
const maybeBuild = flags.maybeBuildId
|
|
44
|
+
? await this.maybeGetBuildAsync(graphqlClient, flags.maybeBuildId)
|
|
45
|
+
: undefined;
|
|
46
|
+
const platform = (_b = maybeBuild === null || maybeBuild === void 0 ? void 0 : maybeBuild.platform.toLowerCase()) !== null && _b !== void 0 ? _b : (await (0, platform_1.selectPlatformAsync)(flags.platform));
|
|
47
|
+
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
48
|
+
throw new Error('Re-signing archives is not supported on Android yet.');
|
|
49
|
+
}
|
|
50
|
+
await (0, _1.handleDeprecatedEasJsonAsync)(projectDir, flags.nonInteractive);
|
|
51
|
+
await (0, statuspageService_1.maybeWarnAboutEasOutagesAsync)(graphqlClient, [generated_1.StatuspageServiceName.EasBuild]);
|
|
52
|
+
const easJsonAccessor = new eas_json_1.EasJsonAccessor(projectDir);
|
|
53
|
+
const easJsonCliConfig = (_c = (await eas_json_1.EasJsonUtils.getCliConfigAsync(easJsonAccessor))) !== null && _c !== void 0 ? _c : {};
|
|
54
|
+
const buildProfile = await eas_json_1.EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, (_d = flags.profile) !== null && _d !== void 0 ? _d : 'production');
|
|
55
|
+
const { exp, projectId } = await getDynamicProjectConfigAsync({ env: buildProfile.env });
|
|
56
|
+
const account = await (0, projectUtils_1.getOwnerAccountForProjectIdAsync)(graphqlClient, projectId);
|
|
57
|
+
const build = await this.ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset }, maybeBuild);
|
|
58
|
+
const credentialsCtx = new context_1.CredentialsContext({
|
|
59
|
+
projectInfo: { exp, projectId },
|
|
60
|
+
nonInteractive,
|
|
61
|
+
projectDir,
|
|
62
|
+
user: actor,
|
|
63
|
+
graphqlClient,
|
|
64
|
+
analytics,
|
|
65
|
+
env: buildProfile.env,
|
|
66
|
+
easJsonCliConfig,
|
|
67
|
+
});
|
|
68
|
+
if (buildProfile.credentialsSource !== eas_json_1.CredentialsSource.LOCAL && !nonInteractive) {
|
|
69
|
+
await credentialsCtx.appStore.ensureAuthenticatedAsync();
|
|
70
|
+
}
|
|
71
|
+
const xcodeBuildContext = await (0, scheme_1.resolveXcodeBuildContextAsync)({
|
|
72
|
+
projectDir,
|
|
73
|
+
nonInteractive,
|
|
74
|
+
exp,
|
|
75
|
+
}, buildProfile);
|
|
76
|
+
const targets = await (0, target_1.resolveTargetsAsync)({
|
|
77
|
+
projectDir,
|
|
78
|
+
exp,
|
|
79
|
+
xcodeBuildContext,
|
|
80
|
+
env: buildProfile.env,
|
|
81
|
+
});
|
|
82
|
+
const credentialsResult = await (0, credentials_1.ensureIosCredentialsForBuildResignAsync)(credentialsCtx, targets, buildProfile);
|
|
83
|
+
(0, assert_1.default)((_e = build.artifacts) === null || _e === void 0 ? void 0 : _e.applicationArchiveUrl, 'Missing application archive.');
|
|
84
|
+
const jobOverrides = {
|
|
85
|
+
mode: generated_1.BuildMode.Resign,
|
|
86
|
+
type: generated_1.BuildWorkflow.Unknown,
|
|
87
|
+
resign: {
|
|
88
|
+
applicationArchiveSource: {
|
|
89
|
+
type: generated_1.ProjectArchiveSourceType.Url,
|
|
90
|
+
url: (_f = build.artifacts) === null || _f === void 0 ? void 0 : _f.applicationArchiveUrl,
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
secrets: (0, prepareJob_1.prepareCredentialsToResign)(credentialsResult.credentials),
|
|
94
|
+
builderEnvironment: { image: 'default' },
|
|
95
|
+
};
|
|
96
|
+
const newBuild = await BuildMutation_1.BuildMutation.retryIosBuildAsync(graphqlClient, {
|
|
97
|
+
buildId: build.id,
|
|
98
|
+
jobOverrides,
|
|
99
|
+
});
|
|
100
|
+
log_1.default.addNewLineIfNone();
|
|
101
|
+
(0, printBuildInfo_1.printLogsUrls)([newBuild]);
|
|
102
|
+
log_1.default.newLine();
|
|
103
|
+
if (!flags.wait) {
|
|
104
|
+
if (flags.json) {
|
|
105
|
+
(0, json_1.printJsonOnlyOutput)(newBuild);
|
|
106
|
+
}
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
const buildResult = await (0, build_1.waitForBuildEndAsync)(graphqlClient, {
|
|
110
|
+
buildIds: [newBuild.id],
|
|
111
|
+
accountName: account.name,
|
|
112
|
+
});
|
|
113
|
+
if (!flags.json) {
|
|
114
|
+
(0, printBuildInfo_1.printBuildResults)(buildResult);
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
(0, assert_1.default)(buildResult[0], 'missing build results');
|
|
118
|
+
(0, json_1.printJsonOnlyOutput)(buildResult[0]);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
sanitizeFlags(flags) {
|
|
122
|
+
const nonInteractive = flags['non-interactive'];
|
|
123
|
+
if (nonInteractive && !flags.id) {
|
|
124
|
+
throw new Error(`${chalk_1.default.bold('--id')} is required when running with ${chalk_1.default.bold('--non-interactive')} flag.`);
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
json: flags.json,
|
|
128
|
+
nonInteractive,
|
|
129
|
+
offset: flags.offset,
|
|
130
|
+
limit: flags.limit,
|
|
131
|
+
platform: flags.platform,
|
|
132
|
+
profile: flags.profile,
|
|
133
|
+
maybeBuildId: flags.id,
|
|
134
|
+
wait: flags.wait,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async ensureBuildSelectedAsync({ graphqlClient, projectId, platform, nonInteractive, limit, offset, }, maybeBuild) {
|
|
138
|
+
if (maybeBuild) {
|
|
139
|
+
return maybeBuild;
|
|
140
|
+
}
|
|
141
|
+
const build = await (0, queries_1.listAndSelectBuildOnAppAsync)(graphqlClient, {
|
|
142
|
+
projectId,
|
|
143
|
+
title: 'Which build would you like to re-sign with new credentials?',
|
|
144
|
+
paginatedQueryOptions: {
|
|
145
|
+
limit,
|
|
146
|
+
offset: offset !== null && offset !== void 0 ? offset : 0,
|
|
147
|
+
nonInteractive,
|
|
148
|
+
json: false,
|
|
149
|
+
},
|
|
150
|
+
filter: {
|
|
151
|
+
distribution: generated_1.DistributionType.Internal,
|
|
152
|
+
platform: (0, AppPlatform_1.toAppPlatform)(platform),
|
|
153
|
+
status: generated_1.BuildStatus.Finished,
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
if (!build) {
|
|
157
|
+
throw new Error('There are no builds that can be re-signed on this project.');
|
|
158
|
+
}
|
|
159
|
+
return build;
|
|
160
|
+
}
|
|
161
|
+
async maybeGetBuildAsync(graphqlClient, maybeBuildId, maybePlatform) {
|
|
162
|
+
if (maybeBuildId) {
|
|
163
|
+
const build = await BuildQuery_1.BuildQuery.byIdAsync(graphqlClient, maybeBuildId);
|
|
164
|
+
if (build.distribution !== generated_1.DistributionType.Internal) {
|
|
165
|
+
throw new Error('This is not an internal distribution build.');
|
|
166
|
+
}
|
|
167
|
+
if (build.status !== generated_1.BuildStatus.Finished) {
|
|
168
|
+
throw new Error('Only builds that finished successfully can be re-signed.');
|
|
169
|
+
}
|
|
170
|
+
if (maybePlatform && build.platform !== (0, AppPlatform_1.toAppPlatform)(maybePlatform)) {
|
|
171
|
+
throw new Error(`Build with ID ${maybeBuildId} was not created for platform ${platform_1.requestedPlatformDisplayNames[maybePlatform]}.`);
|
|
172
|
+
}
|
|
173
|
+
return build;
|
|
174
|
+
}
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.default = BuildResign;
|
|
179
|
+
_a = BuildResign;
|
|
180
|
+
BuildResign.description = 're-sign a build archive';
|
|
181
|
+
BuildResign.flags = {
|
|
182
|
+
platform: core_1.Flags.enum({
|
|
183
|
+
char: 'p',
|
|
184
|
+
options: ['android', 'ios'],
|
|
185
|
+
}),
|
|
186
|
+
profile: core_1.Flags.string({
|
|
187
|
+
char: 'e',
|
|
188
|
+
description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
189
|
+
helpValue: 'PROFILE_NAME',
|
|
190
|
+
}),
|
|
191
|
+
wait: core_1.Flags.boolean({
|
|
192
|
+
default: true,
|
|
193
|
+
allowNo: true,
|
|
194
|
+
description: 'Wait for build(s) to complete.',
|
|
195
|
+
}),
|
|
196
|
+
id: core_1.Flags.string({
|
|
197
|
+
description: 'ID of the build to re-sign.',
|
|
198
|
+
}),
|
|
199
|
+
...pagination_1.EasPaginatedQueryFlags,
|
|
200
|
+
...flags_1.EasNonInteractiveAndJsonFlags,
|
|
201
|
+
};
|
|
202
|
+
BuildResign.contextDefinition = {
|
|
203
|
+
..._a.ContextOptions.LoggedIn,
|
|
204
|
+
..._a.ContextOptions.DynamicProjectConfig,
|
|
205
|
+
..._a.ContextOptions.ProjectDir,
|
|
206
|
+
..._a.ContextOptions.Analytics,
|
|
207
|
+
};
|
|
@@ -66,7 +66,7 @@ class ChannelEdit extends EasCommand_1.default {
|
|
|
66
66
|
: await (0, queries_1.selectBranchOnAppAsync)(graphqlClient, {
|
|
67
67
|
projectId,
|
|
68
68
|
promptTitle: `Which branch would you like ${existingChannel.name} to point at?`,
|
|
69
|
-
displayTextForListItem: updateBranch => updateBranch.name,
|
|
69
|
+
displayTextForListItem: updateBranch => ({ title: updateBranch.name }),
|
|
70
70
|
paginatedQueryOptions: {
|
|
71
71
|
json,
|
|
72
72
|
nonInteractive,
|
|
@@ -3,6 +3,7 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
7
8
|
const flags_1 = require("../../commandUtils/flags");
|
|
8
9
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
@@ -15,14 +16,26 @@ class UpdateConfigure extends EasCommand_1.default {
|
|
|
15
16
|
nonInteractive: flags['non-interactive'],
|
|
16
17
|
});
|
|
17
18
|
log_1.default.log('💡 The following process will configure your project to run EAS Update. These changes only apply to your local project files and you can safely revert them at any time.');
|
|
18
|
-
await (0, configure_1.
|
|
19
|
+
await (0, configure_1.ensureEASUpdateIsConfiguredAsync)(graphqlClient, {
|
|
19
20
|
exp,
|
|
20
21
|
projectId,
|
|
21
22
|
projectDir,
|
|
22
23
|
platform,
|
|
23
24
|
});
|
|
24
25
|
log_1.default.addNewLineIfNone();
|
|
25
|
-
log_1.default.log(`🎉 Your app is configured
|
|
26
|
+
log_1.default.log(`🎉 Your app is configured with EAS Update!`);
|
|
27
|
+
log_1.default.newLine();
|
|
28
|
+
log_1.default.log(`${chalk_1.default.bold('Next steps')}:`);
|
|
29
|
+
log_1.default.newLine();
|
|
30
|
+
log_1.default.log('Update a production build:');
|
|
31
|
+
log_1.default.log(`1. Create a new build. Example: ${chalk_1.default.bold('eas build --profile production')}.`);
|
|
32
|
+
log_1.default.log('2. Make changes in your project.');
|
|
33
|
+
log_1.default.log(`3. Publish an update. Example: ${chalk_1.default.bold('eas update --channel production')}.`);
|
|
34
|
+
log_1.default.log('4. Force close and reopen the app at least twice to view the update.');
|
|
35
|
+
log_1.default.newLine();
|
|
36
|
+
log_1.default.log('Preview an update:');
|
|
37
|
+
log_1.default.log(`1. Publish an update to a branch. Example: ${chalk_1.default.bold('eas update --branch new-feature')}.`);
|
|
38
|
+
log_1.default.log('2. In Expo Go or a development build, navigate to Projects > [project name] > Branch > Open.');
|
|
26
39
|
}
|
|
27
40
|
}
|
|
28
41
|
exports.default = UpdateConfigure;
|
|
@@ -7,6 +7,7 @@ export default class UpdatePublish extends EasCommand {
|
|
|
7
7
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
8
|
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
9
|
branch: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
|
+
channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
10
11
|
message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
11
12
|
republish: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
13
|
group: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|