@expo/build-tools 18.6.0 → 18.8.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/dist/builders/ios.js +15 -2
- package/dist/common/easBuildInternal.js +3 -27
- package/dist/common/setup.js +1 -4
- package/dist/context.js +3 -1
- package/dist/ios/fastlane.d.ts +4 -1
- package/dist/ios/fastlane.js +9 -1
- package/dist/ios/gymfile.d.ts +5 -2
- package/dist/ios/gymfile.js +5 -2
- package/dist/steps/easFunctions.js +10 -0
- package/dist/steps/functionGroups/build.js +4 -0
- package/dist/steps/functions/configureIosCredentials.js +9 -3
- package/dist/steps/functions/configureIosVersion.js +32 -14
- package/dist/steps/functions/deploy.d.ts +2 -0
- package/dist/steps/functions/deploy.js +136 -0
- package/dist/steps/functions/eagerBundle.js +1 -1
- package/dist/steps/functions/export.d.ts +2 -0
- package/dist/steps/functions/export.js +115 -0
- package/dist/steps/functions/generateGymfileFromTemplate.js +9 -0
- package/dist/steps/functions/installNodeModules.js +1 -1
- package/dist/steps/functions/parseXcactivitylog.d.ts +2 -0
- package/dist/steps/functions/parseXcactivitylog.js +49 -0
- package/dist/steps/functions/prebuild.js +1 -1
- package/dist/steps/functions/readAppConfig.d.ts +2 -0
- package/dist/steps/functions/readAppConfig.js +39 -0
- package/dist/steps/functions/readPackageJson.d.ts +2 -0
- package/dist/steps/functions/readPackageJson.js +28 -0
- package/dist/steps/functions/restoreBuildCache.js +1 -1
- package/dist/steps/functions/saveBuildCache.js +1 -1
- package/dist/steps/functions/startAndroidEmulator.js +28 -0
- package/dist/steps/utils/ios/xcactivitylog.d.ts +57 -0
- package/dist/steps/utils/ios/xcactivitylog.js +278 -0
- package/dist/templates/GymfileArchive.d.ts +1 -1
- package/dist/templates/GymfileArchive.js +4 -0
- package/dist/templates/GymfileSimulator.d.ts +1 -1
- package/dist/templates/GymfileSimulator.js +3 -0
- package/dist/utils/easCli.d.ts +11 -0
- package/dist/utils/easCli.js +57 -0
- package/dist/utils/packageManager.d.ts +4 -1
- package/dist/utils/packageManager.js +13 -4
- package/dist/utils/project.d.ts +3 -0
- package/dist/utils/project.js +7 -0
- package/package.json +4 -4
package/dist/builders/ios.js
CHANGED
|
@@ -20,6 +20,7 @@ const fastlane_1 = require("../ios/fastlane");
|
|
|
20
20
|
const pod_1 = require("../ios/pod");
|
|
21
21
|
const resign_1 = require("../ios/resign");
|
|
22
22
|
const resolve_1 = require("../ios/resolve");
|
|
23
|
+
const xcactivitylog_1 = require("../steps/utils/ios/xcactivitylog");
|
|
23
24
|
const restoreBuildCache_1 = require("../steps/functions/restoreBuildCache");
|
|
24
25
|
const saveBuildCache_1 = require("../steps/functions/saveBuildCache");
|
|
25
26
|
const artifacts_1 = require("../utils/artifacts");
|
|
@@ -52,6 +53,7 @@ async function buildAsync(ctx) {
|
|
|
52
53
|
const evictUsedBefore = new Date();
|
|
53
54
|
const credentialsManager = new manager_1.default(ctx);
|
|
54
55
|
const workingDirectory = ctx.getReactNativeProjectDirectory();
|
|
56
|
+
let fastlaneResult;
|
|
55
57
|
try {
|
|
56
58
|
const credentials = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PREPARE_CREDENTIALS, async () => {
|
|
57
59
|
return await credentialsManager.prepare();
|
|
@@ -132,10 +134,10 @@ async function buildAsync(ctx) {
|
|
|
132
134
|
});
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
|
-
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_FASTLANE, async () => {
|
|
137
|
+
fastlaneResult = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.RUN_FASTLANE, async () => {
|
|
136
138
|
const scheme = (0, resolve_1.resolveScheme)(ctx);
|
|
137
139
|
const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });
|
|
138
|
-
await (0, fastlane_1.runFastlaneGym)(ctx, {
|
|
140
|
+
return await (0, fastlane_1.runFastlaneGym)(ctx, {
|
|
139
141
|
credentials,
|
|
140
142
|
scheme,
|
|
141
143
|
buildConfiguration,
|
|
@@ -156,6 +158,17 @@ async function buildAsync(ctx) {
|
|
|
156
158
|
await credentialsManager.cleanUp();
|
|
157
159
|
});
|
|
158
160
|
}
|
|
161
|
+
if (ctx.env.EXPERIMENTAL_EAS_XCACTIVITYLOG === '1') {
|
|
162
|
+
const { derivedDataPath, workspacePath } = (0, nullthrows_1.default)(fastlaneResult);
|
|
163
|
+
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PARSE_XCACTIVITYLOG, async () => {
|
|
164
|
+
await (0, xcactivitylog_1.parseAndReportXcactivitylog)({
|
|
165
|
+
derivedDataPath,
|
|
166
|
+
workspacePath,
|
|
167
|
+
logger: ctx.logger,
|
|
168
|
+
proxyBaseUrl: ctx.env.EAS_BUILD_COCOAPODS_CACHE_URL,
|
|
169
|
+
});
|
|
170
|
+
});
|
|
171
|
+
}
|
|
159
172
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {
|
|
160
173
|
await (0, hooks_1.runHookIfPresent)(ctx, hooks_1.Hook.PRE_UPLOAD_ARTIFACTS);
|
|
161
174
|
});
|
|
@@ -11,13 +11,13 @@ const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
|
11
11
|
const assert_1 = __importDefault(require("assert"));
|
|
12
12
|
const joi_1 = __importDefault(require("joi"));
|
|
13
13
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
14
|
-
const
|
|
14
|
+
const easCli_1 = require("../utils/easCli");
|
|
15
15
|
const EasBuildInternalResultSchema = joi_1.default.object({
|
|
16
16
|
job: joi_1.default.object().unknown(),
|
|
17
17
|
metadata: joi_1.default.object().unknown(),
|
|
18
18
|
});
|
|
19
19
|
async function runEasBuildInternalAsync({ job, logger, env, cwd, projectRootOverride, }) {
|
|
20
|
-
const { cmd, args, extraEnv } = await resolveEasCommandPrefixAndEnvAsync();
|
|
20
|
+
const { cmd, args, extraEnv } = await (0, easCli_1.resolveEasCommandPrefixAndEnvAsync)();
|
|
21
21
|
const { buildProfile, githubTriggerOptions } = job;
|
|
22
22
|
(0, assert_1.default)(buildProfile, 'build profile is missing in a build from git-based integration.');
|
|
23
23
|
const autoSubmitArgs = [];
|
|
@@ -57,7 +57,7 @@ async function runEasBuildInternalAsync({ job, logger, env, cwd, projectRootOver
|
|
|
57
57
|
});
|
|
58
58
|
}
|
|
59
59
|
async function resolveEnvFromBuildProfileAsync(ctx, { cwd }) {
|
|
60
|
-
const { cmd, args, extraEnv } = await resolveEasCommandPrefixAndEnvAsync();
|
|
60
|
+
const { cmd, args, extraEnv } = await (0, easCli_1.resolveEasCommandPrefixAndEnvAsync)();
|
|
61
61
|
const { buildProfile } = ctx.job;
|
|
62
62
|
(0, assert_1.default)(buildProfile, 'build profile is missing in a build from git-based integration.');
|
|
63
63
|
let spawnResult;
|
|
@@ -87,30 +87,6 @@ async function resolveEnvFromBuildProfileAsync(ctx, { cwd }) {
|
|
|
87
87
|
const env = validateEnvs(parsed.buildProfile);
|
|
88
88
|
return env;
|
|
89
89
|
}
|
|
90
|
-
async function resolveEasCommandPrefixAndEnvAsync() {
|
|
91
|
-
const npxArgsPrefix = (await (0, packageManager_1.isAtLeastNpm7Async)()) ? ['-y'] : [];
|
|
92
|
-
if (process.env.ENVIRONMENT === 'development') {
|
|
93
|
-
return {
|
|
94
|
-
cmd: 'npx',
|
|
95
|
-
args: [...npxArgsPrefix, `eas-cli@${eas_build_job_1.EasCliNpmTags.STAGING}`],
|
|
96
|
-
extraEnv: {},
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
else if (process.env.ENVIRONMENT === 'staging') {
|
|
100
|
-
return {
|
|
101
|
-
cmd: 'npx',
|
|
102
|
-
args: [...npxArgsPrefix, `eas-cli@${eas_build_job_1.EasCliNpmTags.STAGING}`],
|
|
103
|
-
extraEnv: { EXPO_STAGING: '1' },
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
return {
|
|
108
|
-
cmd: 'npx',
|
|
109
|
-
args: [...npxArgsPrefix, `eas-cli@${eas_build_job_1.EasCliNpmTags.PRODUCTION}`],
|
|
110
|
-
extraEnv: {},
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
90
|
function validateEasBuildInternalResult({ oldJob, result, }) {
|
|
115
91
|
const { value, error } = EasBuildInternalResultSchema.validate(result, {
|
|
116
92
|
stripUnknown: true,
|
package/dist/common/setup.js
CHANGED
|
@@ -65,10 +65,7 @@ async function setupAsync(ctx) {
|
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
const packageJson = await ctx.runBuildPhase(eas_build_job_1.BuildPhase.READ_PACKAGE_JSON, async () => {
|
|
68
|
-
ctx.logger.
|
|
69
|
-
const packageJson = (0, project_1.readPackageJson)(ctx.getReactNativeProjectDirectory());
|
|
70
|
-
ctx.logger.info(JSON.stringify(packageJson, null, 2));
|
|
71
|
-
return packageJson;
|
|
68
|
+
return (0, project_1.readAndLogPackageJson)(ctx.logger, ctx.getReactNativeProjectDirectory());
|
|
72
69
|
});
|
|
73
70
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.INSTALL_DEPENDENCIES, async () => {
|
|
74
71
|
const expoVersion = ctx.metadata?.sdkVersion ??
|
package/dist/context.js
CHANGED
|
@@ -104,7 +104,9 @@ class BuildContext {
|
|
|
104
104
|
return path_1.default.join(this.workingdir, 'env');
|
|
105
105
|
}
|
|
106
106
|
get packageManager() {
|
|
107
|
-
return (0, packageManager_1.resolvePackageManager)(this.getReactNativeProjectDirectory()
|
|
107
|
+
return (0, packageManager_1.resolvePackageManager)(this.getReactNativeProjectDirectory(), {
|
|
108
|
+
env: this.env,
|
|
109
|
+
});
|
|
108
110
|
}
|
|
109
111
|
get appConfig() {
|
|
110
112
|
if (!this._appConfig) {
|
package/dist/ios/fastlane.d.ts
CHANGED
|
@@ -9,7 +9,10 @@ export declare function runFastlaneGym<TJob extends Ios.Job>(ctx: BuildContext<T
|
|
|
9
9
|
credentials: Credentials | null;
|
|
10
10
|
entitlements: object | null;
|
|
11
11
|
extraEnv?: Env;
|
|
12
|
-
}): Promise<
|
|
12
|
+
}): Promise<{
|
|
13
|
+
derivedDataPath: string;
|
|
14
|
+
workspacePath: string;
|
|
15
|
+
}>;
|
|
13
16
|
export declare function runFastlaneResign<TJob extends Ios.Job>(ctx: BuildContext<TJob>, { credentials, ipaPath }: {
|
|
14
17
|
credentials: Credentials;
|
|
15
18
|
ipaPath: string;
|
package/dist/ios/fastlane.js
CHANGED
|
@@ -9,6 +9,7 @@ exports.runFastlane = runFastlane;
|
|
|
9
9
|
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
10
10
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
11
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
12
|
+
const os_1 = __importDefault(require("os"));
|
|
12
13
|
const path_1 = __importDefault(require("path"));
|
|
13
14
|
const fastfile_1 = require("./fastfile");
|
|
14
15
|
const gymfile_1 = require("./gymfile");
|
|
@@ -17,6 +18,8 @@ const xcpretty_1 = require("./xcpretty");
|
|
|
17
18
|
const fastlane_1 = require("../common/fastlane");
|
|
18
19
|
const context_1 = require("../context");
|
|
19
20
|
async function runFastlaneGym(ctx, { scheme, buildConfiguration, credentials, entitlements, extraEnv, }) {
|
|
21
|
+
const workspacePath = path_1.default.join(ctx.getReactNativeProjectDirectory(), 'ios');
|
|
22
|
+
const derivedDataPath = path_1.default.join(workspacePath, 'build');
|
|
20
23
|
await ensureGymfileExists(ctx, {
|
|
21
24
|
scheme,
|
|
22
25
|
buildConfiguration,
|
|
@@ -31,7 +34,7 @@ async function runFastlaneGym(ctx, { scheme, buildConfiguration, credentials, en
|
|
|
31
34
|
void buildLogger.watchLogFiles(ctx.buildLogsDirectory);
|
|
32
35
|
try {
|
|
33
36
|
await runFastlane(['gym'], {
|
|
34
|
-
cwd:
|
|
37
|
+
cwd: workspacePath,
|
|
35
38
|
logger: ctx.logger,
|
|
36
39
|
env: { ...ctx.env, ...extraEnv },
|
|
37
40
|
});
|
|
@@ -39,6 +42,7 @@ async function runFastlaneGym(ctx, { scheme, buildConfiguration, credentials, en
|
|
|
39
42
|
finally {
|
|
40
43
|
await buildLogger.flush();
|
|
41
44
|
}
|
|
45
|
+
return { derivedDataPath, workspacePath };
|
|
42
46
|
}
|
|
43
47
|
async function runFastlaneResign(ctx, { credentials, ipaPath }) {
|
|
44
48
|
const { certificateCommonName } = credentials.applicationTargetProvisioningProfile.data;
|
|
@@ -75,6 +79,7 @@ async function ensureGymfileExists(ctx, { scheme, buildConfiguration, credential
|
|
|
75
79
|
return;
|
|
76
80
|
}
|
|
77
81
|
ctx.logger.info('Creating Gymfile');
|
|
82
|
+
const resultBundlePath = path_1.default.join(os_1.default.tmpdir(), `result-bundle-${Date.now()}.xcresult`);
|
|
78
83
|
if (ctx.job.simulator) {
|
|
79
84
|
const isTV = await (0, tvos_1.isTVOS)(ctx);
|
|
80
85
|
const simulatorDestination = `generic/platform=${isTV ? 'tvOS' : 'iOS'} Simulator`;
|
|
@@ -83,6 +88,7 @@ async function ensureGymfileExists(ctx, { scheme, buildConfiguration, credential
|
|
|
83
88
|
scheme,
|
|
84
89
|
buildConfiguration: buildConfiguration ?? 'release',
|
|
85
90
|
derivedDataPath: './build',
|
|
91
|
+
resultBundlePath,
|
|
86
92
|
clean: false,
|
|
87
93
|
logsDirectory,
|
|
88
94
|
simulatorDestination,
|
|
@@ -95,6 +101,8 @@ async function ensureGymfileExists(ctx, { scheme, buildConfiguration, credential
|
|
|
95
101
|
scheme,
|
|
96
102
|
buildConfiguration,
|
|
97
103
|
outputDirectory: './build',
|
|
104
|
+
derivedDataPath: './build',
|
|
105
|
+
resultBundlePath,
|
|
98
106
|
clean: false,
|
|
99
107
|
logsDirectory,
|
|
100
108
|
entitlements: entitlements ?? undefined,
|
package/dist/ios/gymfile.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ interface ArchiveBuildOptions {
|
|
|
5
5
|
scheme: string;
|
|
6
6
|
buildConfiguration?: string;
|
|
7
7
|
outputDirectory: string;
|
|
8
|
+
derivedDataPath: string;
|
|
9
|
+
resultBundlePath: string;
|
|
8
10
|
clean: boolean;
|
|
9
11
|
logsDirectory: string;
|
|
10
12
|
entitlements?: object;
|
|
@@ -14,10 +16,11 @@ interface SimulatorBuildOptions {
|
|
|
14
16
|
scheme: string;
|
|
15
17
|
buildConfiguration?: string;
|
|
16
18
|
derivedDataPath: string;
|
|
19
|
+
resultBundlePath: string;
|
|
17
20
|
clean: boolean;
|
|
18
21
|
logsDirectory: string;
|
|
19
22
|
simulatorDestination: string;
|
|
20
23
|
}
|
|
21
|
-
export declare function createGymfileForArchiveBuild({ outputFile, clean, credentials, scheme, buildConfiguration, entitlements, outputDirectory, logsDirectory, }: ArchiveBuildOptions): Promise<void>;
|
|
22
|
-
export declare function createGymfileForSimulatorBuild({ outputFile, clean, scheme, buildConfiguration, derivedDataPath, logsDirectory, simulatorDestination, }: SimulatorBuildOptions): Promise<void>;
|
|
24
|
+
export declare function createGymfileForArchiveBuild({ outputFile, clean, credentials, scheme, buildConfiguration, entitlements, outputDirectory, derivedDataPath, resultBundlePath, logsDirectory, }: ArchiveBuildOptions): Promise<void>;
|
|
25
|
+
export declare function createGymfileForSimulatorBuild({ outputFile, clean, scheme, buildConfiguration, derivedDataPath, resultBundlePath, logsDirectory, simulatorDestination, }: SimulatorBuildOptions): Promise<void>;
|
|
23
26
|
export {};
|
package/dist/ios/gymfile.js
CHANGED
|
@@ -9,7 +9,7 @@ const template_file_1 = require("@expo/template-file");
|
|
|
9
9
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
10
|
const GymfileArchive_1 = require("../templates/GymfileArchive");
|
|
11
11
|
const GymfileSimulator_1 = require("../templates/GymfileSimulator");
|
|
12
|
-
async function createGymfileForArchiveBuild({ outputFile, clean, credentials, scheme, buildConfiguration, entitlements, outputDirectory, logsDirectory, }) {
|
|
12
|
+
async function createGymfileForArchiveBuild({ outputFile, clean, credentials, scheme, buildConfiguration, entitlements, outputDirectory, derivedDataPath, resultBundlePath, logsDirectory, }) {
|
|
13
13
|
const PROFILES = [];
|
|
14
14
|
const targets = Object.keys(credentials.targetProvisioningProfiles);
|
|
15
15
|
for (const target of targets) {
|
|
@@ -29,6 +29,8 @@ async function createGymfileForArchiveBuild({ outputFile, clean, credentials, sc
|
|
|
29
29
|
SCHEME: scheme,
|
|
30
30
|
SCHEME_BUILD_CONFIGURATION: buildConfiguration,
|
|
31
31
|
OUTPUT_DIRECTORY: outputDirectory,
|
|
32
|
+
DERIVED_DATA_PATH: derivedDataPath,
|
|
33
|
+
RESULT_BUNDLE_PATH: resultBundlePath,
|
|
32
34
|
EXPORT_METHOD: credentials.distributionType,
|
|
33
35
|
CLEAN: String(clean),
|
|
34
36
|
LOGS_DIRECTORY: logsDirectory,
|
|
@@ -37,7 +39,7 @@ async function createGymfileForArchiveBuild({ outputFile, clean, credentials, sc
|
|
|
37
39
|
},
|
|
38
40
|
});
|
|
39
41
|
}
|
|
40
|
-
async function createGymfileForSimulatorBuild({ outputFile, clean, scheme, buildConfiguration, derivedDataPath, logsDirectory, simulatorDestination, }) {
|
|
42
|
+
async function createGymfileForSimulatorBuild({ outputFile, clean, scheme, buildConfiguration, derivedDataPath, resultBundlePath, logsDirectory, simulatorDestination, }) {
|
|
41
43
|
await fs_extra_1.default.mkdirp(logsDirectory);
|
|
42
44
|
await createGymfile({
|
|
43
45
|
template: GymfileSimulator_1.GymfileSimulatorTemplate,
|
|
@@ -47,6 +49,7 @@ async function createGymfileForSimulatorBuild({ outputFile, clean, scheme, build
|
|
|
47
49
|
SCHEME_BUILD_CONFIGURATION: buildConfiguration,
|
|
48
50
|
SCHEME_SIMULATOR_DESTINATION: simulatorDestination,
|
|
49
51
|
DERIVED_DATA_PATH: derivedDataPath,
|
|
52
|
+
RESULT_BUNDLE_PATH: resultBundlePath,
|
|
50
53
|
CLEAN: String(clean),
|
|
51
54
|
LOGS_DIRECTORY: logsDirectory,
|
|
52
55
|
},
|
|
@@ -10,6 +10,8 @@ const configureIosVersion_1 = require("./functions/configureIosVersion");
|
|
|
10
10
|
const createSubmissionEntity_1 = require("./functions/createSubmissionEntity");
|
|
11
11
|
const downloadArtifact_1 = require("./functions/downloadArtifact");
|
|
12
12
|
const downloadBuild_1 = require("./functions/downloadBuild");
|
|
13
|
+
const deploy_1 = require("./functions/deploy");
|
|
14
|
+
const export_1 = require("./functions/export");
|
|
13
15
|
const eagerBundle_1 = require("./functions/eagerBundle");
|
|
14
16
|
const findAndUploadBuildArtifacts_1 = require("./functions/findAndUploadBuildArtifacts");
|
|
15
17
|
const generateGymfileFromTemplate_1 = require("./functions/generateGymfileFromTemplate");
|
|
@@ -19,13 +21,16 @@ const installMaestro_1 = require("./functions/installMaestro");
|
|
|
19
21
|
const installNodeModules_1 = require("./functions/installNodeModules");
|
|
20
22
|
const installPods_1 = require("./functions/installPods");
|
|
21
23
|
const prebuild_1 = require("./functions/prebuild");
|
|
24
|
+
const readAppConfig_1 = require("./functions/readAppConfig");
|
|
22
25
|
const readIpaInfo_1 = require("./functions/readIpaInfo");
|
|
26
|
+
const readPackageJson_1 = require("./functions/readPackageJson");
|
|
23
27
|
const repack_1 = require("./functions/repack");
|
|
24
28
|
const reportMaestroTestResults_1 = require("./functions/reportMaestroTestResults");
|
|
25
29
|
const resolveAppleTeamIdFromCredentials_1 = require("./functions/resolveAppleTeamIdFromCredentials");
|
|
26
30
|
const resolveBuildConfig_1 = require("./functions/resolveBuildConfig");
|
|
27
31
|
const restoreBuildCache_1 = require("./functions/restoreBuildCache");
|
|
28
32
|
const restoreCache_1 = require("./functions/restoreCache");
|
|
33
|
+
const parseXcactivitylog_1 = require("./functions/parseXcactivitylog");
|
|
29
34
|
const runFastlane_1 = require("./functions/runFastlane");
|
|
30
35
|
const runGradle_1 = require("./functions/runGradle");
|
|
31
36
|
const saveBuildCache_1 = require("./functions/saveBuildCache");
|
|
@@ -43,10 +48,14 @@ function getEasFunctions(ctx) {
|
|
|
43
48
|
(0, downloadArtifact_1.createDownloadArtifactFunction)(),
|
|
44
49
|
(0, uploadArtifact_1.createUploadArtifactBuildFunction)(ctx),
|
|
45
50
|
(0, useNpmToken_1.createSetUpNpmrcBuildFunction)(),
|
|
51
|
+
(0, readPackageJson_1.createReadPackageJsonBuildFunction)(),
|
|
52
|
+
(0, readAppConfig_1.createReadAppConfigBuildFunction)(),
|
|
46
53
|
(0, installNodeModules_1.createInstallNodeModulesBuildFunction)(),
|
|
47
54
|
(0, prebuild_1.createPrebuildBuildFunction)(),
|
|
48
55
|
(0, readIpaInfo_1.createReadIpaInfoBuildFunction)(),
|
|
49
56
|
(0, downloadBuild_1.createDownloadBuildFunction)(),
|
|
57
|
+
(0, export_1.createEasExportBuildFunction)(),
|
|
58
|
+
(0, deploy_1.createEasDeployBuildFunction)(),
|
|
50
59
|
(0, repack_1.createRepackBuildFunction)(),
|
|
51
60
|
(0, restoreCache_1.createRestoreCacheFunction)(),
|
|
52
61
|
(0, restoreBuildCache_1.createRestoreBuildCacheFunction)(),
|
|
@@ -63,6 +72,7 @@ function getEasFunctions(ctx) {
|
|
|
63
72
|
(0, configureIosVersion_1.configureIosVersionFunction)(),
|
|
64
73
|
(0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)(),
|
|
65
74
|
(0, runFastlane_1.runFastlaneFunction)(),
|
|
75
|
+
(0, parseXcactivitylog_1.parseXcactivitylogFunction)(),
|
|
66
76
|
(0, startAndroidEmulator_1.createStartAndroidEmulatorBuildFunction)(),
|
|
67
77
|
(0, startCuttlefishDevice_1.createStartCuttlefishDeviceBuildFunction)(),
|
|
68
78
|
(0, startIosSimulator_1.createStartIosSimulatorBuildFunction)(),
|
|
@@ -200,10 +200,14 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, w
|
|
|
200
200
|
installPods,
|
|
201
201
|
configureEASUpdate,
|
|
202
202
|
(0, configureIosCredentials_1.configureIosCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
203
|
+
id: 'configure_ios_credentials',
|
|
203
204
|
workingDirectory,
|
|
204
205
|
}),
|
|
205
206
|
(0, configureIosVersion_1.configureIosVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
|
|
206
207
|
workingDirectory,
|
|
208
|
+
callInputs: {
|
|
209
|
+
target_names: '${{ steps.configure_ios_credentials.outputs.target_names }}',
|
|
210
|
+
},
|
|
207
211
|
}),
|
|
208
212
|
...((0, eagerBundle_1.shouldUseEagerBundle)(globalCtx.staticContext.metadata)
|
|
209
213
|
? [
|
|
@@ -29,9 +29,14 @@ function configureIosCredentialsFunction() {
|
|
|
29
29
|
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
30
30
|
}),
|
|
31
31
|
],
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
outputProviders: [
|
|
33
|
+
steps_1.BuildStepOutput.createProvider({
|
|
34
|
+
id: 'target_names',
|
|
35
|
+
required: true,
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
fn: async (stepCtx, { inputs, outputs }) => {
|
|
39
|
+
const { value, error } = credentials_1.IosBuildCredentialsSchema.validate(inputs.credentials.value, {
|
|
35
40
|
stripUnknown: true,
|
|
36
41
|
convert: true,
|
|
37
42
|
abortEarly: false,
|
|
@@ -47,6 +52,7 @@ function configureIosCredentialsFunction() {
|
|
|
47
52
|
credentials,
|
|
48
53
|
buildConfiguration: (0, resolve_1.resolveBuildConfiguration)(job, inputs.build_configuration.value),
|
|
49
54
|
});
|
|
55
|
+
outputs.target_names.set(JSON.stringify(Object.keys(credentials.targetProvisioningProfiles)));
|
|
50
56
|
stepCtx.logger.info('Successfully configured iOS credentials');
|
|
51
57
|
},
|
|
52
58
|
});
|
|
@@ -4,9 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.configureIosVersionFunction = configureIosVersionFunction;
|
|
7
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
8
|
const steps_1 = require("@expo/steps");
|
|
8
9
|
const assert_1 = __importDefault(require("assert"));
|
|
9
10
|
const semver_1 = __importDefault(require("semver"));
|
|
11
|
+
const zod_1 = require("zod");
|
|
10
12
|
const configure_1 = require("../utils/ios/configure");
|
|
11
13
|
const credentials_1 = require("../utils/ios/credentials/credentials");
|
|
12
14
|
const manager_1 = __importDefault(require("../utils/ios/credentials/manager"));
|
|
@@ -20,10 +22,15 @@ function configureIosVersionFunction() {
|
|
|
20
22
|
inputProviders: [
|
|
21
23
|
steps_1.BuildStepInput.createProvider({
|
|
22
24
|
id: 'credentials',
|
|
23
|
-
required:
|
|
25
|
+
required: false,
|
|
24
26
|
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.JSON,
|
|
25
27
|
defaultValue: '${ eas.job.secrets.buildCredentials }',
|
|
26
28
|
}),
|
|
29
|
+
steps_1.BuildStepInput.createProvider({
|
|
30
|
+
id: 'target_names',
|
|
31
|
+
required: false,
|
|
32
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.JSON,
|
|
33
|
+
}),
|
|
27
34
|
steps_1.BuildStepInput.createProvider({
|
|
28
35
|
id: 'build_configuration',
|
|
29
36
|
required: false,
|
|
@@ -41,28 +48,39 @@ function configureIosVersionFunction() {
|
|
|
41
48
|
}),
|
|
42
49
|
],
|
|
43
50
|
fn: async (stepCtx, { inputs }) => {
|
|
44
|
-
const rawCredentialsInput = inputs.credentials.value;
|
|
45
|
-
const { value, error } = credentials_1.IosBuildCredentialsSchema.validate(rawCredentialsInput, {
|
|
46
|
-
stripUnknown: true,
|
|
47
|
-
convert: true,
|
|
48
|
-
abortEarly: false,
|
|
49
|
-
});
|
|
50
|
-
if (error) {
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
const credentialsManager = new manager_1.default(value);
|
|
54
|
-
const credentials = await credentialsManager.prepare(stepCtx.logger);
|
|
55
51
|
(0, assert_1.default)(stepCtx.global.staticContext.job, 'Job is not defined');
|
|
56
52
|
const job = stepCtx.global.staticContext.job;
|
|
57
53
|
const buildNumber = inputs.build_number.value ?? job.version?.buildNumber;
|
|
58
54
|
const appVersion = inputs.app_version.value ?? job.version?.appVersion;
|
|
59
55
|
if (appVersion && !semver_1.default.valid(appVersion)) {
|
|
60
|
-
throw new
|
|
56
|
+
throw new eas_build_job_1.UserError('EAS_CONFIGURE_IOS_VERSION_INVALID_APP_VERSION', `App version provided by the "app_version" input is not a valid semver version: ${appVersion}`);
|
|
61
57
|
}
|
|
62
58
|
if (!buildNumber && !appVersion) {
|
|
63
59
|
stepCtx.logger.info('No build number or app version provided. Skipping the step to configure iOS version.');
|
|
64
60
|
return;
|
|
65
61
|
}
|
|
62
|
+
const targetNamesInput = inputs.target_names.value;
|
|
63
|
+
let targetNames;
|
|
64
|
+
if (targetNamesInput !== undefined) {
|
|
65
|
+
const parsed = zod_1.z.array(zod_1.z.string()).safeParse(targetNamesInput);
|
|
66
|
+
if (!parsed.success) {
|
|
67
|
+
throw new eas_build_job_1.UserError('EAS_CONFIGURE_IOS_VERSION_INVALID_TARGET_NAMES', '"target_names" input must be an array of strings.', { cause: parsed.error });
|
|
68
|
+
}
|
|
69
|
+
targetNames = parsed.data;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const { value, error } = credentials_1.IosBuildCredentialsSchema.validate(inputs.credentials.value, {
|
|
73
|
+
stripUnknown: true,
|
|
74
|
+
convert: true,
|
|
75
|
+
abortEarly: false,
|
|
76
|
+
});
|
|
77
|
+
if (error) {
|
|
78
|
+
throw error;
|
|
79
|
+
}
|
|
80
|
+
const credentialsManager = new manager_1.default(value);
|
|
81
|
+
const credentials = await credentialsManager.prepare(stepCtx.logger);
|
|
82
|
+
targetNames = Object.keys(credentials.targetProvisioningProfiles);
|
|
83
|
+
}
|
|
66
84
|
stepCtx.logger.info('Setting iOS version...');
|
|
67
85
|
if (buildNumber) {
|
|
68
86
|
stepCtx.logger.info(`Build number: ${buildNumber}`);
|
|
@@ -74,7 +92,7 @@ function configureIosVersionFunction() {
|
|
|
74
92
|
buildNumber,
|
|
75
93
|
appVersion,
|
|
76
94
|
}, {
|
|
77
|
-
targetNames
|
|
95
|
+
targetNames,
|
|
78
96
|
buildConfiguration: (0, resolve_1.resolveBuildConfiguration)(job, inputs.build_configuration.value),
|
|
79
97
|
});
|
|
80
98
|
},
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createEasDeployBuildFunction = createEasDeployBuildFunction;
|
|
4
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
+
const logger_1 = require("@expo/logger");
|
|
6
|
+
const steps_1 = require("@expo/steps");
|
|
7
|
+
const easCli_1 = require("../../utils/easCli");
|
|
8
|
+
function createEasDeployBuildFunction() {
|
|
9
|
+
return new steps_1.BuildFunction({
|
|
10
|
+
namespace: 'eas',
|
|
11
|
+
id: 'deploy',
|
|
12
|
+
name: 'Deploy',
|
|
13
|
+
__metricsId: 'eas/deploy',
|
|
14
|
+
inputProviders: [
|
|
15
|
+
steps_1.BuildStepInput.createProvider({
|
|
16
|
+
id: 'alias',
|
|
17
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
18
|
+
required: false,
|
|
19
|
+
}),
|
|
20
|
+
steps_1.BuildStepInput.createProvider({
|
|
21
|
+
id: 'prod',
|
|
22
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
23
|
+
required: false,
|
|
24
|
+
}),
|
|
25
|
+
steps_1.BuildStepInput.createProvider({
|
|
26
|
+
id: 'source_maps',
|
|
27
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
28
|
+
required: false,
|
|
29
|
+
}),
|
|
30
|
+
// Match eas/export default `output_dir`
|
|
31
|
+
steps_1.BuildStepInput.createProvider({
|
|
32
|
+
id: 'export_dir',
|
|
33
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
34
|
+
required: false,
|
|
35
|
+
defaultValue: 'dist',
|
|
36
|
+
}),
|
|
37
|
+
],
|
|
38
|
+
outputProviders: [
|
|
39
|
+
steps_1.BuildStepOutput.createProvider({
|
|
40
|
+
id: 'deploy_json',
|
|
41
|
+
required: true,
|
|
42
|
+
}),
|
|
43
|
+
steps_1.BuildStepOutput.createProvider({
|
|
44
|
+
id: 'deploy_url',
|
|
45
|
+
required: false,
|
|
46
|
+
}),
|
|
47
|
+
steps_1.BuildStepOutput.createProvider({
|
|
48
|
+
id: 'deploy_deployment_url',
|
|
49
|
+
required: false,
|
|
50
|
+
}),
|
|
51
|
+
steps_1.BuildStepOutput.createProvider({
|
|
52
|
+
id: 'deploy_identifier',
|
|
53
|
+
required: false,
|
|
54
|
+
}),
|
|
55
|
+
steps_1.BuildStepOutput.createProvider({
|
|
56
|
+
id: 'deploy_dashboard_url',
|
|
57
|
+
required: false,
|
|
58
|
+
}),
|
|
59
|
+
steps_1.BuildStepOutput.createProvider({
|
|
60
|
+
id: 'deploy_alias_url',
|
|
61
|
+
required: false,
|
|
62
|
+
}),
|
|
63
|
+
],
|
|
64
|
+
fn: async (stepsCtx, { inputs, outputs, env }) => {
|
|
65
|
+
const alias = inputs.alias.value;
|
|
66
|
+
const prod = inputs.prod.value;
|
|
67
|
+
const sourceMaps = inputs.source_maps.value;
|
|
68
|
+
const exportDir = inputs.export_dir.value;
|
|
69
|
+
const deployCommand = getDeployCommand({
|
|
70
|
+
exportDir,
|
|
71
|
+
alias,
|
|
72
|
+
prod,
|
|
73
|
+
sourceMaps,
|
|
74
|
+
});
|
|
75
|
+
stepsCtx.logger.info(`Running deploy command: eas ${deployCommand.join(' ')}`);
|
|
76
|
+
try {
|
|
77
|
+
const result = await (0, easCli_1.runEasCliCommand)({
|
|
78
|
+
args: deployCommand,
|
|
79
|
+
options: {
|
|
80
|
+
cwd: stepsCtx.workingDirectory,
|
|
81
|
+
env,
|
|
82
|
+
logger: stepsCtx.logger,
|
|
83
|
+
mode: logger_1.PipeMode.STDERR_ONLY_AS_STDOUT,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
const deployJson = result.stdout.toString();
|
|
87
|
+
outputs.deploy_json.set(deployJson);
|
|
88
|
+
const parsedDeploymentOutput = parseDeploymentOutput({
|
|
89
|
+
deployJson,
|
|
90
|
+
logger: stepsCtx.logger,
|
|
91
|
+
});
|
|
92
|
+
outputs.deploy_url.set(parsedDeploymentOutput.deploy_url);
|
|
93
|
+
outputs.deploy_deployment_url.set(parsedDeploymentOutput.deploy_deployment_url);
|
|
94
|
+
outputs.deploy_identifier.set(parsedDeploymentOutput.deploy_identifier);
|
|
95
|
+
outputs.deploy_dashboard_url.set(parsedDeploymentOutput.deploy_dashboard_url);
|
|
96
|
+
outputs.deploy_alias_url.set(parsedDeploymentOutput.deploy_alias_url);
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
const errorMessage = error instanceof Error ? error.message : 'unknown error';
|
|
100
|
+
throw new eas_build_job_1.UserError('EAS_DEPLOY_FAILED', 'Deploy command failed.\n\n' +
|
|
101
|
+
`This can happen when deploy inputs are invalid, the export directory "${exportDir}" is missing, or EAS CLI authentication/network checks fail.\n` +
|
|
102
|
+
'Check the deploy step logs, verify your deploy configuration and exported files, then retry.\n' +
|
|
103
|
+
`Original error: ${errorMessage}`, { cause: error });
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
function getDeployCommand({ exportDir, alias, prod, sourceMaps, }) {
|
|
109
|
+
const deployCommand = ['deploy', '--non-interactive', '--json', '--export-dir', exportDir];
|
|
110
|
+
if (alias) {
|
|
111
|
+
deployCommand.push('--alias', alias);
|
|
112
|
+
}
|
|
113
|
+
if (prod) {
|
|
114
|
+
deployCommand.push('--prod');
|
|
115
|
+
}
|
|
116
|
+
if (sourceMaps) {
|
|
117
|
+
deployCommand.push('--source-maps');
|
|
118
|
+
}
|
|
119
|
+
return deployCommand;
|
|
120
|
+
}
|
|
121
|
+
function parseDeploymentOutput({ deployJson, logger }) {
|
|
122
|
+
try {
|
|
123
|
+
const deployObject = JSON.parse(deployJson);
|
|
124
|
+
return {
|
|
125
|
+
deploy_url: deployObject.production?.url || deployObject.aliases?.[0]?.url || deployObject.url,
|
|
126
|
+
deploy_deployment_url: deployObject.url,
|
|
127
|
+
deploy_identifier: deployObject.identifier,
|
|
128
|
+
deploy_dashboard_url: deployObject.dashboardUrl,
|
|
129
|
+
deploy_alias_url: deployObject.aliases?.[0]?.url,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
logger.warn({ err: error }, 'Failed to parse "eas deploy" JSON output. Some outputs expected from this step will be undefined.');
|
|
134
|
+
return {};
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -30,7 +30,7 @@ function eagerBundleBuildFunction() {
|
|
|
30
30
|
!semver_1.default.satisfies(stepsCtx.global.staticContext.metadata?.sdkVersion, '>=52')) {
|
|
31
31
|
throw new Error('Eager bundle is not supported for SDK version < 52');
|
|
32
32
|
}
|
|
33
|
-
const packageManager = (0, packageManager_1.resolvePackageManager)(stepsCtx.workingDirectory);
|
|
33
|
+
const packageManager = (0, packageManager_1.resolvePackageManager)(stepsCtx.workingDirectory, { env });
|
|
34
34
|
const resolvedEASUpdateRuntimeVersion = inputs.resolved_eas_update_runtime_version.value;
|
|
35
35
|
await (0, eagerBundle_1.eagerBundleAsync)({
|
|
36
36
|
platform: job.platform,
|