eas-cli 0.55.1 → 0.58.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 +58 -49
- package/build/branch/queries.d.ts +5 -0
- package/build/branch/queries.js +87 -0
- package/build/build/android/build.js +17 -3
- package/build/build/android/graphql.js +2 -0
- package/build/build/android/prepareJob.js +5 -0
- package/build/build/android/syncProjectConfiguration.d.ts +3 -4
- package/build/build/android/syncProjectConfiguration.js +2 -3
- package/build/build/android/version.d.ts +16 -0
- package/build/build/android/version.js +86 -9
- package/build/build/build.js +8 -3
- package/build/build/context.d.ts +7 -3
- package/build/build/createContext.d.ts +5 -2
- package/build/build/createContext.js +9 -1
- package/build/build/ios/build.js +18 -17
- package/build/build/ios/graphql.js +2 -0
- package/build/build/ios/prepareJob.js +5 -0
- package/build/build/ios/syncProjectConfiguration.d.ts +5 -6
- package/build/build/ios/syncProjectConfiguration.js +3 -4
- package/build/build/ios/version.d.ts +23 -3
- package/build/build/ios/version.js +128 -28
- package/build/build/local.d.ts +2 -2
- package/build/build/local.js +7 -7
- package/build/build/metadata.d.ts +1 -0
- package/build/build/metadata.js +32 -6
- package/build/build/runBuildAndSubmit.d.ts +1 -0
- package/build/build/runBuildAndSubmit.js +29 -7
- package/build/build/utils/printBuildInfo.d.ts +1 -1
- package/build/build/utils/printBuildInfo.js +7 -13
- package/build/commandUtils/pagination.d.ts +13 -0
- package/build/commandUtils/pagination.js +42 -0
- package/build/commands/branch/list.d.ts +3 -4
- package/build/commands/branch/list.js +6 -69
- package/build/commands/branch/view.d.ts +3 -0
- package/build/commands/branch/view.js +15 -63
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +9 -0
- package/build/commands/build/version/set.d.ts +9 -0
- package/build/commands/build/version/set.js +81 -0
- package/build/commands/build/version/sync.d.ts +11 -0
- package/build/commands/build/version/sync.js +123 -0
- package/build/commands/submit.js +4 -1
- package/build/commands/update/index.d.ts +2 -2
- package/build/commands/update/index.js +24 -6
- package/build/commands/update/list.js +13 -18
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +2 -2
- package/build/credentials/ios/types.d.ts +2 -0
- package/build/devices/actions/create/action.d.ts +5 -2
- package/build/devices/actions/create/action.js +12 -2
- package/build/devices/actions/create/developerPortalMethod.d.ts +6 -0
- package/build/devices/actions/create/developerPortalMethod.js +90 -0
- package/build/devices/manager.js +4 -4
- package/build/graphql/generated.d.ts +501 -59
- package/build/graphql/generated.js +10 -1
- package/build/graphql/mutations/AppVersionMutation.d.ts +11 -0
- package/build/graphql/mutations/AppVersionMutation.js +28 -0
- package/build/graphql/mutations/PublishMutation.d.ts +2 -4
- package/build/graphql/queries/AppVersionQuery.d.ts +4 -0
- package/build/graphql/queries/AppVersionQuery.js +37 -0
- package/build/graphql/queries/BranchQuery.d.ts +2 -1
- package/build/graphql/queries/BranchQuery.js +26 -0
- package/build/graphql/queries/BuildQuery.d.ts +4 -1
- package/build/graphql/queries/BuildQuery.js +19 -0
- package/build/graphql/queries/PublishQuery.d.ts +2 -1
- package/build/graphql/queries/PublishQuery.js +16 -0
- package/build/graphql/queries/UpdateQuery.d.ts +6 -8
- package/build/graphql/queries/UpdateQuery.js +27 -23
- package/build/graphql/types/Build.d.ts +1 -0
- package/build/graphql/types/Build.js +16 -1
- package/build/metadata/apple/config/reader.d.ts +3 -2
- package/build/metadata/apple/config/reader.js +22 -5
- package/build/metadata/apple/config/writer.d.ts +3 -2
- package/build/metadata/apple/config/writer.js +22 -6
- package/build/metadata/apple/tasks/app-version.d.ts +5 -1
- package/build/metadata/apple/tasks/app-version.js +109 -8
- package/build/metadata/apple/tasks/index.d.ts +6 -1
- package/build/metadata/apple/tasks/index.js +7 -2
- package/build/metadata/apple/types.d.ts +3 -7
- package/build/metadata/upload.js +6 -1
- package/build/platform.d.ts +1 -0
- package/build/platform.js +17 -1
- package/build/project/android/applicationId.js +2 -2
- package/build/project/android/versions.d.ts +3 -0
- package/build/project/android/versions.js +23 -0
- package/build/project/applicationIdentifier.d.ts +4 -0
- package/build/project/applicationIdentifier.js +37 -0
- package/build/project/ios/bundleIdentifier.js +2 -2
- package/build/project/ios/target.js +14 -1
- package/build/project/ios/versions.d.ts +3 -0
- package/build/project/ios/versions.js +17 -0
- package/build/project/publish.d.ts +3 -2
- package/build/project/publish.js +23 -18
- package/build/project/remoteVersionSource.d.ts +8 -0
- package/build/project/remoteVersionSource.js +61 -0
- package/build/submit/submit.d.ts +2 -1
- package/build/submit/submit.js +3 -2
- package/build/submit/utils/files.d.ts +0 -6
- package/build/submit/utils/files.js +3 -16
- package/build/update/queries.d.ts +3 -0
- package/build/update/queries.js +72 -0
- package/build/update/utils.d.ts +14 -0
- package/build/update/utils.js +26 -9
- package/build/uploads.d.ts +8 -2
- package/build/uploads.js +19 -4
- package/build/utils/expodash/chunk.d.ts +1 -0
- package/build/utils/expodash/chunk.js +16 -0
- package/build/utils/queries.d.ts +25 -0
- package/build/utils/queries.js +67 -0
- package/build/vcs/clients/gitNoCommit.d.ts +1 -0
- package/build/vcs/clients/gitNoCommit.js +14 -0
- package/oclif.manifest.json +1 -1
- package/package.json +10 -5
- package/schema/metadata-0.json +38 -233
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.maybeResolveVersionsAsync = exports.bumpVersionInAppJsonAsync = exports.bumpVersionAsync = exports.BumpStrategy = void 0;
|
|
3
|
+
exports.resolveRemoteVersionCodeAsync = exports.updateNativeVersionsAsync = exports.maybeResolveVersionsAsync = exports.bumpVersionInAppJsonAsync = exports.bumpVersionAsync = exports.BumpStrategy = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
6
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
7
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
8
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
|
+
const generated_1 = require("../../graphql/generated");
|
|
10
|
+
const AppVersionMutation_1 = require("../../graphql/mutations/AppVersionMutation");
|
|
11
|
+
const AppVersionQuery_1 = require("../../graphql/queries/AppVersionQuery");
|
|
9
12
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
13
|
+
const ora_1 = require("../../ora");
|
|
10
14
|
const gradleUtils_1 = require("../../project/android/gradleUtils");
|
|
15
|
+
const versions_1 = require("../../project/android/versions");
|
|
11
16
|
const workflow_1 = require("../../project/workflow");
|
|
12
17
|
const appJson_1 = require("../utils/appJson");
|
|
13
18
|
const version_1 = require("../utils/version");
|
|
@@ -18,7 +23,7 @@ var BumpStrategy;
|
|
|
18
23
|
BumpStrategy[BumpStrategy["NOOP"] = 2] = "NOOP";
|
|
19
24
|
})(BumpStrategy = exports.BumpStrategy || (exports.BumpStrategy = {}));
|
|
20
25
|
async function bumpVersionAsync({ bumpStrategy, projectDir, exp, }) {
|
|
21
|
-
var _a, _b;
|
|
26
|
+
var _a, _b, _c;
|
|
22
27
|
if (bumpStrategy === BumpStrategy.NOOP) {
|
|
23
28
|
return;
|
|
24
29
|
}
|
|
@@ -30,9 +35,10 @@ async function bumpVersionAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
30
35
|
}
|
|
31
36
|
await bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp });
|
|
32
37
|
log_1.default.log('Updated versions in app.json');
|
|
33
|
-
await
|
|
38
|
+
await updateNativeVersionsAsync({
|
|
34
39
|
projectDir,
|
|
35
|
-
exp,
|
|
40
|
+
version: exp.version,
|
|
41
|
+
versionCode: (_c = exp.android) === null || _c === void 0 ? void 0 : _c.versionCode,
|
|
36
42
|
});
|
|
37
43
|
log_1.default.log('Synchronized versions with build gradle');
|
|
38
44
|
}
|
|
@@ -50,7 +56,7 @@ async function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }) {
|
|
|
50
56
|
}
|
|
51
57
|
else {
|
|
52
58
|
const versionCode = config_plugins_1.AndroidConfig.Version.getVersionCode(exp);
|
|
53
|
-
const bumpedVersionCode = versionCode
|
|
59
|
+
const bumpedVersionCode = (0, versions_1.getNextVersionCode)(versionCode);
|
|
54
60
|
log_1.default.log(`Bumping ${chalk_1.default.bold('expo.android.versionCode')} from ${chalk_1.default.bold(versionCode)} to ${chalk_1.default.bold(bumpedVersionCode)}`);
|
|
55
61
|
await (0, appJson_1.updateAppJsonConfigAsync)({ projectDir, exp }, config => {
|
|
56
62
|
config.android = { ...config.android, versionCode: bumpedVersionCode };
|
|
@@ -84,16 +90,21 @@ async function maybeResolveVersionsAsync(projectDir, exp, buildProfile) {
|
|
|
84
90
|
}
|
|
85
91
|
}
|
|
86
92
|
exports.maybeResolveVersionsAsync = maybeResolveVersionsAsync;
|
|
87
|
-
async function
|
|
93
|
+
async function updateNativeVersionsAsync({ projectDir, version, versionCode, }) {
|
|
88
94
|
const buildGradle = await readBuildGradleAsync(projectDir);
|
|
89
95
|
if (!buildGradle) {
|
|
90
96
|
throw new Error('This project is missing a build.gradle file.');
|
|
91
97
|
}
|
|
92
|
-
let updatedBuildGradle =
|
|
93
|
-
|
|
98
|
+
let updatedBuildGradle = buildGradle;
|
|
99
|
+
if (version !== undefined) {
|
|
100
|
+
updatedBuildGradle = updatedBuildGradle.replace(new RegExp(`versionName ".*"`), `versionName "${version}"`);
|
|
101
|
+
}
|
|
102
|
+
if (versionCode !== undefined) {
|
|
103
|
+
updatedBuildGradle = updatedBuildGradle.replace(new RegExp(`versionCode.*`), `versionCode ${versionCode}`);
|
|
104
|
+
}
|
|
94
105
|
await writeBuildGradleAsync({ projectDir, buildGradle: updatedBuildGradle });
|
|
95
|
-
return updatedBuildGradle;
|
|
96
106
|
}
|
|
107
|
+
exports.updateNativeVersionsAsync = updateNativeVersionsAsync;
|
|
97
108
|
async function readBuildGradleAsync(projectDir) {
|
|
98
109
|
const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
|
|
99
110
|
if (!(await fs_extra_1.default.pathExists(buildGradlePath))) {
|
|
@@ -105,3 +116,69 @@ async function writeBuildGradleAsync({ projectDir, buildGradle, }) {
|
|
|
105
116
|
const buildGradlePath = config_plugins_1.AndroidConfig.Paths.getAppBuildGradleFilePath(projectDir);
|
|
106
117
|
await fs_extra_1.default.writeFile(buildGradlePath, buildGradle);
|
|
107
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Returns buildNumber that will be used for the next build. If current build profile
|
|
121
|
+
* has an 'autoIncrement' option set, it increments the version on server.
|
|
122
|
+
*/
|
|
123
|
+
async function resolveRemoteVersionCodeAsync({ projectDir, projectId, exp, applicationId, buildProfile, }) {
|
|
124
|
+
var _a, _b, _c, _d, _e, _f;
|
|
125
|
+
const remoteVersions = await AppVersionQuery_1.AppVersionQuery.latestVersionAsync(projectId, generated_1.AppPlatform.Android, applicationId);
|
|
126
|
+
const localVersions = await maybeResolveVersionsAsync(projectDir, exp, buildProfile);
|
|
127
|
+
let currentBuildVersion;
|
|
128
|
+
if (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion) {
|
|
129
|
+
currentBuildVersion = remoteVersions.buildVersion;
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
if (localVersions.appBuildVersion) {
|
|
133
|
+
log_1.default.warn('No remote versions are configured for this project, versionCode will be initialized based on the value from the local project.');
|
|
134
|
+
currentBuildVersion = localVersions.appBuildVersion;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
log_1.default.error(`Remote versions are not configured and EAS CLI was not able to read the current version from your project. Use "eas build:version:set" to initialize remote versions.`);
|
|
138
|
+
throw new Error('Remote versions are not configured.');
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (!buildProfile.autoIncrement && (remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)) {
|
|
142
|
+
return currentBuildVersion;
|
|
143
|
+
}
|
|
144
|
+
else if (!buildProfile.autoIncrement && !(remoteVersions === null || remoteVersions === void 0 ? void 0 : remoteVersions.buildVersion)) {
|
|
145
|
+
const spinner = (0, ora_1.ora)(`Initializing the versionCode with ${currentBuildVersion}.`).start();
|
|
146
|
+
try {
|
|
147
|
+
await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync({
|
|
148
|
+
appId: projectId,
|
|
149
|
+
platform: generated_1.AppPlatform.Android,
|
|
150
|
+
applicationIdentifier: applicationId,
|
|
151
|
+
storeVersion: (_b = (_a = localVersions.appVersion) !== null && _a !== void 0 ? _a : exp.version) !== null && _b !== void 0 ? _b : '1.0.0',
|
|
152
|
+
buildVersion: currentBuildVersion,
|
|
153
|
+
runtimeVersion: (_c = config_plugins_1.Updates.getRuntimeVersionNullable(exp, eas_build_job_1.Platform.ANDROID)) !== null && _c !== void 0 ? _c : undefined,
|
|
154
|
+
});
|
|
155
|
+
spinner.succeed(`Initialized the versionCode with ${currentBuildVersion}.`);
|
|
156
|
+
}
|
|
157
|
+
catch (err) {
|
|
158
|
+
spinner.fail(`Failed to initialize the versionCode with ${currentBuildVersion}.`);
|
|
159
|
+
throw err;
|
|
160
|
+
}
|
|
161
|
+
return currentBuildVersion;
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
const nextBuildVersion = (0, versions_1.getNextVersionCode)(currentBuildVersion);
|
|
165
|
+
const spinner = (0, ora_1.ora)(`Incrementing the versionCode ${currentBuildVersion} -> ${nextBuildVersion}.`).start();
|
|
166
|
+
try {
|
|
167
|
+
await AppVersionMutation_1.AppVersionMutation.createAppVersionAsync({
|
|
168
|
+
appId: projectId,
|
|
169
|
+
platform: generated_1.AppPlatform.Android,
|
|
170
|
+
applicationIdentifier: applicationId,
|
|
171
|
+
storeVersion: (_e = (_d = localVersions.appVersion) !== null && _d !== void 0 ? _d : exp.version) !== null && _e !== void 0 ? _e : '1.0.0',
|
|
172
|
+
buildVersion: String(nextBuildVersion),
|
|
173
|
+
runtimeVersion: (_f = config_plugins_1.Updates.getRuntimeVersionNullable(exp, eas_build_job_1.Platform.ANDROID)) !== null && _f !== void 0 ? _f : undefined,
|
|
174
|
+
});
|
|
175
|
+
spinner.succeed(`Incremented the versionCode ${currentBuildVersion} -> ${nextBuildVersion}.`);
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
spinner.fail(`Failed to increment the versionCode ${currentBuildVersion} -> ${nextBuildVersion}.`);
|
|
179
|
+
throw err;
|
|
180
|
+
}
|
|
181
|
+
return String(nextBuildVersion);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
exports.resolveRemoteVersionCodeAsync = resolveRemoteVersionCodeAsync;
|
package/build/build/build.js
CHANGED
|
@@ -64,7 +64,7 @@ async function prepareBuildRequestForPlatformAsync(builder) {
|
|
|
64
64
|
});
|
|
65
65
|
return async () => {
|
|
66
66
|
if (ctx.localBuildOptions.enable) {
|
|
67
|
-
await (0, local_1.runLocalBuildAsync)(job, ctx.localBuildOptions);
|
|
67
|
+
await (0, local_1.runLocalBuildAsync)(job, metadata, ctx.localBuildOptions);
|
|
68
68
|
return undefined;
|
|
69
69
|
}
|
|
70
70
|
else {
|
|
@@ -109,7 +109,7 @@ async function uploadProjectAsync(ctx) {
|
|
|
109
109
|
log_1.default.log(`Compressing project files and uploading to EAS Build. ${(0, log_1.learnMore)('https://expo.fyi/eas-build-archive')}`);
|
|
110
110
|
const projectTarball = await (0, repository_1.makeProjectTarballAsync)();
|
|
111
111
|
projectTarballPath = projectTarball.path;
|
|
112
|
-
const { bucketKey } = await (0, uploads_1.
|
|
112
|
+
const { bucketKey } = await (0, uploads_1.uploadFileAtPathToS3Async)(generated_1.UploadSessionType.EasBuildProjectSources, projectTarball.path, (0, progress_1.createProgressTracker)({
|
|
113
113
|
total: projectTarball.size,
|
|
114
114
|
message: ratio => `Uploading to EAS Build (${(0, files_1.formatBytes)(projectTarball.size * ratio)} / ${(0, files_1.formatBytes)(projectTarball.size)})`,
|
|
115
115
|
completedMessage: (duration) => `Uploaded to EAS ${chalk_1.default.dim(duration)}`,
|
|
@@ -225,7 +225,7 @@ async function handleSingleBuildProgressAsync({ build, accountName }, { spinner
|
|
|
225
225
|
log_1.default.log(`Sign up for EAS Production or Enterprise at ${chalk_1.default.underline(formatAccountSubscriptionsUrl(accountName))}`);
|
|
226
226
|
}
|
|
227
227
|
log_1.default.newLine();
|
|
228
|
-
log_1.default.log(
|
|
228
|
+
log_1.default.log(`Waiting in ${priorityToQueueDisplayName[build.priority]}`);
|
|
229
229
|
queueProgressBar.start(build.initialQueuePosition + 1, build.initialQueuePosition - build.queuePosition + 1, progressBarPayload);
|
|
230
230
|
queueProgressBarStarted = true;
|
|
231
231
|
}
|
|
@@ -254,6 +254,11 @@ async function handleSingleBuildProgressAsync({ build, accountName }, { spinner
|
|
|
254
254
|
}
|
|
255
255
|
return { refetch: true };
|
|
256
256
|
}
|
|
257
|
+
const priorityToQueueDisplayName = {
|
|
258
|
+
[generated_1.BuildPriority.Normal]: 'queue',
|
|
259
|
+
[generated_1.BuildPriority.NormalPlus]: 'queue',
|
|
260
|
+
[generated_1.BuildPriority.High]: 'priority queue',
|
|
261
|
+
};
|
|
257
262
|
const statusToDisplayName = {
|
|
258
263
|
[generated_1.BuildStatus.New]: 'waiting to enter the queue (concurrency limit reached)',
|
|
259
264
|
[generated_1.BuildStatus.InQueue]: 'in queue',
|
package/build/build/context.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
2
|
import { Platform, Workflow } from '@expo/eas-build-job';
|
|
3
|
-
import { BuildProfile } from '@expo/eas-json';
|
|
4
|
-
import type { XCBuildConfiguration } from 'xcode';
|
|
3
|
+
import { BuildProfile, EasJson } from '@expo/eas-json';
|
|
5
4
|
import { TrackingContext } from '../analytics/common';
|
|
6
5
|
import { CredentialsContext } from '../credentials/context';
|
|
7
6
|
import { Target } from '../credentials/ios/types';
|
|
@@ -14,16 +13,18 @@ export declare type CommonContext<T extends Platform> = Omit<BuildContext<T>, 'a
|
|
|
14
13
|
export interface AndroidBuildContext {
|
|
15
14
|
applicationId: string;
|
|
16
15
|
gradleContext?: GradleBuildContext;
|
|
16
|
+
versionCodeOverride?: string;
|
|
17
17
|
}
|
|
18
18
|
export interface IosBuildContext {
|
|
19
19
|
bundleIdentifier: string;
|
|
20
|
-
applicationTargetBuildSettings: XCBuildConfiguration['buildSettings'];
|
|
21
20
|
applicationTarget: Target;
|
|
22
21
|
targets: Target[];
|
|
23
22
|
xcodeBuildContext: XcodeBuildContext;
|
|
23
|
+
buildNumberOverride?: string;
|
|
24
24
|
}
|
|
25
25
|
export interface BuildContext<T extends Platform> {
|
|
26
26
|
accountName: string;
|
|
27
|
+
easJsonCliConfig: EasJson['cli'];
|
|
27
28
|
buildProfile: BuildProfile<T>;
|
|
28
29
|
buildProfileName: string;
|
|
29
30
|
resourceClass: BuildResourceClass;
|
|
@@ -32,10 +33,13 @@ export interface BuildContext<T extends Platform> {
|
|
|
32
33
|
exp: ExpoConfig;
|
|
33
34
|
localBuildOptions: LocalBuildOptions;
|
|
34
35
|
nonInteractive: boolean;
|
|
36
|
+
noWait: boolean;
|
|
37
|
+
runFromCI: boolean;
|
|
35
38
|
platform: T;
|
|
36
39
|
projectDir: string;
|
|
37
40
|
projectId: string;
|
|
38
41
|
projectName: string;
|
|
42
|
+
message?: string;
|
|
39
43
|
trackingCtx: TrackingContext;
|
|
40
44
|
user: Actor;
|
|
41
45
|
workflow: Workflow;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { Platform } from '@expo/eas-build-job';
|
|
2
|
-
import { BuildProfile } from '@expo/eas-json';
|
|
2
|
+
import { BuildProfile, EasJson } from '@expo/eas-json';
|
|
3
3
|
import { BuildResourceClass } from '../graphql/generated';
|
|
4
4
|
import { BuildContext } from './context';
|
|
5
5
|
import { LocalBuildOptions } from './local';
|
|
6
|
-
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, clearCache, localBuildOptions, nonInteractive, platform, projectDir, resourceClass, }: {
|
|
6
|
+
export declare function createBuildContextAsync<T extends Platform>({ buildProfileName, buildProfile, easJsonCliConfig, clearCache, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClass, message, }: {
|
|
7
7
|
buildProfileName: string;
|
|
8
8
|
buildProfile: BuildProfile<T>;
|
|
9
|
+
easJsonCliConfig: EasJson['cli'];
|
|
9
10
|
clearCache: boolean;
|
|
10
11
|
localBuildOptions: LocalBuildOptions;
|
|
11
12
|
nonInteractive: boolean;
|
|
13
|
+
noWait: boolean;
|
|
12
14
|
platform: T;
|
|
13
15
|
projectDir: string;
|
|
14
16
|
resourceClass: BuildResourceClass;
|
|
17
|
+
message?: string;
|
|
15
18
|
}): Promise<BuildContext<T>>;
|
|
@@ -4,6 +4,7 @@ exports.createBuildContextAsync = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
6
|
const json_file_1 = tslib_1.__importDefault(require("@expo/json-file"));
|
|
7
|
+
const getenv_1 = tslib_1.__importDefault(require("getenv"));
|
|
7
8
|
const resolve_from_1 = tslib_1.__importDefault(require("resolve-from"));
|
|
8
9
|
const uuid_1 = require("uuid");
|
|
9
10
|
const events_1 = require("../analytics/events");
|
|
@@ -15,7 +16,7 @@ const Account_1 = require("../user/Account");
|
|
|
15
16
|
const actions_1 = require("../user/actions");
|
|
16
17
|
const build_1 = require("./android/build");
|
|
17
18
|
const build_2 = require("./ios/build");
|
|
18
|
-
async function createBuildContextAsync({ buildProfileName, buildProfile, clearCache = false, localBuildOptions, nonInteractive
|
|
19
|
+
async function createBuildContextAsync({ buildProfileName, buildProfile, easJsonCliConfig, clearCache = false, localBuildOptions, nonInteractive, noWait, platform, projectDir, resourceClass, message, }) {
|
|
19
20
|
var _a;
|
|
20
21
|
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, { env: buildProfile.env });
|
|
21
22
|
const user = await (0, actions_1.ensureLoggedInAsync)();
|
|
@@ -24,6 +25,7 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
24
25
|
const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp, { env: buildProfile.env });
|
|
25
26
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, platform);
|
|
26
27
|
const accountId = (_a = (0, Account_1.findAccountByName)(user.accounts, accountName)) === null || _a === void 0 ? void 0 : _a.id;
|
|
28
|
+
const runFromCI = getenv_1.default.boolish('CI', false);
|
|
27
29
|
const credentialsCtx = new context_1.CredentialsContext({
|
|
28
30
|
exp,
|
|
29
31
|
nonInteractive,
|
|
@@ -43,6 +45,8 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
43
45
|
project_id: projectId,
|
|
44
46
|
project_type: workflow,
|
|
45
47
|
...devClientProperties,
|
|
48
|
+
no_wait: noWait,
|
|
49
|
+
run_from_ci: runFromCI,
|
|
46
50
|
};
|
|
47
51
|
events_1.Analytics.logEvent(events_1.BuildEvent.BUILD_COMMAND, trackingCtx);
|
|
48
52
|
const commonContext = {
|
|
@@ -50,11 +54,13 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
50
54
|
buildProfile,
|
|
51
55
|
buildProfileName,
|
|
52
56
|
resourceClass,
|
|
57
|
+
easJsonCliConfig,
|
|
53
58
|
clearCache,
|
|
54
59
|
credentialsCtx,
|
|
55
60
|
exp,
|
|
56
61
|
localBuildOptions,
|
|
57
62
|
nonInteractive,
|
|
63
|
+
noWait,
|
|
58
64
|
platform,
|
|
59
65
|
projectDir,
|
|
60
66
|
projectId,
|
|
@@ -62,6 +68,8 @@ async function createBuildContextAsync({ buildProfileName, buildProfile, clearCa
|
|
|
62
68
|
trackingCtx,
|
|
63
69
|
user,
|
|
64
70
|
workflow,
|
|
71
|
+
message,
|
|
72
|
+
runFromCI,
|
|
65
73
|
};
|
|
66
74
|
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
67
75
|
const common = commonContext;
|
package/build/build/ios/build.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prepareIosBuildAsync = exports.createIosContextAsync = void 0;
|
|
4
|
-
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
6
6
|
const BuildMutation_1 = require("../../graphql/mutations/BuildMutation");
|
|
7
7
|
const bundleIdentifier_1 = require("../../project/ios/bundleIdentifier");
|
|
8
8
|
const scheme_1 = require("../../project/ios/scheme");
|
|
@@ -14,7 +14,9 @@ const credentials_1 = require("./credentials");
|
|
|
14
14
|
const graphql_2 = require("./graphql");
|
|
15
15
|
const prepareJob_1 = require("./prepareJob");
|
|
16
16
|
const syncProjectConfiguration_1 = require("./syncProjectConfiguration");
|
|
17
|
+
const version_1 = require("./version");
|
|
17
18
|
async function createIosContextAsync(ctx) {
|
|
19
|
+
var _a;
|
|
18
20
|
const { buildProfile } = ctx;
|
|
19
21
|
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
20
22
|
await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp);
|
|
@@ -33,13 +35,21 @@ async function createIosContextAsync(ctx) {
|
|
|
33
35
|
env: buildProfile.env,
|
|
34
36
|
});
|
|
35
37
|
const applicationTarget = (0, target_1.findApplicationTarget)(targets);
|
|
36
|
-
const
|
|
38
|
+
const buildNumberOverride = ((_a = ctx.easJsonCliConfig) === null || _a === void 0 ? void 0 : _a.appVersionSource) === eas_json_1.AppVersionSource.REMOTE
|
|
39
|
+
? await (0, version_1.resolveRemoteBuildNumberAsync)({
|
|
40
|
+
projectDir: ctx.projectDir,
|
|
41
|
+
projectId: ctx.projectId,
|
|
42
|
+
exp: ctx.exp,
|
|
43
|
+
applicationTarget,
|
|
44
|
+
buildProfile,
|
|
45
|
+
})
|
|
46
|
+
: undefined;
|
|
37
47
|
return {
|
|
38
48
|
bundleIdentifier: applicationTarget.bundleIdentifier,
|
|
39
49
|
applicationTarget,
|
|
40
|
-
applicationTargetBuildSettings,
|
|
41
50
|
targets,
|
|
42
51
|
xcodeBuildContext,
|
|
52
|
+
buildNumberOverride,
|
|
43
53
|
};
|
|
44
54
|
}
|
|
45
55
|
exports.createIosContextAsync = createIosContextAsync;
|
|
@@ -50,11 +60,14 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
50
60
|
return (0, credentials_1.ensureIosCredentialsAsync)(ctx, ctx.ios.targets);
|
|
51
61
|
},
|
|
52
62
|
syncProjectConfigurationAsync: async () => {
|
|
63
|
+
var _a;
|
|
53
64
|
await (0, syncProjectConfiguration_1.syncProjectConfigurationAsync)({
|
|
54
65
|
projectDir: ctx.projectDir,
|
|
55
66
|
exp: ctx.exp,
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
targets: ctx.ios.targets,
|
|
68
|
+
localAutoIncrement: ((_a = ctx.easJsonCliConfig) === null || _a === void 0 ? void 0 : _a.appVersionSource) === eas_json_1.AppVersionSource.REMOTE
|
|
69
|
+
? false
|
|
70
|
+
: ctx.buildProfile.autoIncrement,
|
|
58
71
|
});
|
|
59
72
|
},
|
|
60
73
|
prepareJobAsync: async (ctx, jobData) => {
|
|
@@ -76,15 +89,3 @@ async function prepareIosBuildAsync(ctx) {
|
|
|
76
89
|
});
|
|
77
90
|
}
|
|
78
91
|
exports.prepareIosBuildAsync = prepareIosBuildAsync;
|
|
79
|
-
function resolveBuildSettings(ctx, applicationTarget) {
|
|
80
|
-
var _a;
|
|
81
|
-
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
82
|
-
return {};
|
|
83
|
-
}
|
|
84
|
-
const project = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(ctx.projectDir);
|
|
85
|
-
const xcBuildConfiguration = config_plugins_1.IOSConfig.Target.getXCBuildConfigurationFromPbxproj(project, {
|
|
86
|
-
targetName: applicationTarget.targetName,
|
|
87
|
-
buildConfiguration: applicationTarget.buildConfiguration,
|
|
88
|
-
});
|
|
89
|
-
return (_a = xcBuildConfiguration === null || xcBuildConfiguration === void 0 ? void 0 : xcBuildConfiguration.buildSettings) !== null && _a !== void 0 ? _a : {};
|
|
90
|
-
}
|
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
6
6
|
const graphql_1 = require("../graphql");
|
|
7
7
|
function transformJob(job) {
|
|
8
|
+
var _a;
|
|
8
9
|
return {
|
|
9
10
|
type: (0, graphql_1.transformWorkflow)(job.type),
|
|
10
11
|
projectArchive: (0, graphql_1.transformProjectArchive)(job.projectArchive),
|
|
@@ -14,6 +15,7 @@ function transformJob(job) {
|
|
|
14
15
|
secrets: transformIosSecrets(job.secrets),
|
|
15
16
|
builderEnvironment: job.builderEnvironment,
|
|
16
17
|
cache: job.cache,
|
|
18
|
+
version: ((_a = job.version) === null || _a === void 0 ? void 0 : _a.buildNumber) ? { buildNumber: job.version.buildNumber } : undefined,
|
|
17
19
|
scheme: job.scheme,
|
|
18
20
|
buildConfiguration: job.buildConfiguration,
|
|
19
21
|
artifactPath: job.artifactPath,
|
|
@@ -54,6 +54,11 @@ async function prepareJobAsync(ctx, jobData) {
|
|
|
54
54
|
buildConfiguration: ctx.buildProfile.buildConfiguration,
|
|
55
55
|
artifactPath: ctx.buildProfile.artifactPath,
|
|
56
56
|
username,
|
|
57
|
+
...(ctx.ios.buildNumberOverride && {
|
|
58
|
+
version: {
|
|
59
|
+
buildNumber: ctx.ios.buildNumberOverride,
|
|
60
|
+
},
|
|
61
|
+
}),
|
|
57
62
|
experimental: {
|
|
58
63
|
prebuildCommand: ctx.buildProfile.prebuildCommand,
|
|
59
64
|
},
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export declare function syncProjectConfigurationAsync({ projectDir, exp, buildProfile, buildSettings, }: {
|
|
2
|
+
import { IosVersionAutoIncrement } from '@expo/eas-json';
|
|
3
|
+
import { Target } from '../../credentials/ios/types';
|
|
4
|
+
export declare function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, }: {
|
|
6
5
|
projectDir: string;
|
|
7
6
|
exp: ExpoConfig;
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
targets: Target[];
|
|
8
|
+
localAutoIncrement?: IosVersionAutoIncrement;
|
|
10
9
|
}): Promise<void>;
|
|
@@ -6,15 +6,14 @@ const projectUtils_1 = require("../../project/projectUtils");
|
|
|
6
6
|
const workflow_1 = require("../../project/workflow");
|
|
7
7
|
const UpdatesModule_1 = require("../../update/ios/UpdatesModule");
|
|
8
8
|
const version_1 = require("./version");
|
|
9
|
-
async function syncProjectConfigurationAsync({ projectDir, exp,
|
|
9
|
+
async function syncProjectConfigurationAsync({ projectDir, exp, targets, localAutoIncrement, }) {
|
|
10
10
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
11
|
-
const
|
|
12
|
-
const versionBumpStrategy = resolveVersionBumpStrategy(autoIncrement !== null && autoIncrement !== void 0 ? autoIncrement : false);
|
|
11
|
+
const versionBumpStrategy = resolveVersionBumpStrategy(localAutoIncrement !== null && localAutoIncrement !== void 0 ? localAutoIncrement : false);
|
|
13
12
|
if (workflow === eas_build_job_1.Workflow.GENERIC) {
|
|
14
13
|
if ((0, projectUtils_1.isExpoUpdatesInstalled)(projectDir)) {
|
|
15
14
|
await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
|
|
16
15
|
}
|
|
17
|
-
await (0, version_1.bumpVersionAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy,
|
|
16
|
+
await (0, version_1.bumpVersionAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy, targets });
|
|
18
17
|
}
|
|
19
18
|
else {
|
|
20
19
|
await (0, version_1.bumpVersionInAppJsonAsync)({ projectDir, exp, bumpStrategy: versionBumpStrategy });
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import { ExpoConfig } from '@expo/config';
|
|
2
|
+
import { Platform } from '@expo/eas-build-job';
|
|
3
|
+
import { BuildProfile } from '@expo/eas-json';
|
|
2
4
|
import type { XCBuildConfiguration } from 'xcode';
|
|
5
|
+
import { Target } from '../../credentials/ios/types';
|
|
3
6
|
export declare enum BumpStrategy {
|
|
4
7
|
APP_VERSION = 0,
|
|
5
8
|
BUILD_NUMBER = 1,
|
|
6
9
|
NOOP = 2
|
|
7
10
|
}
|
|
8
|
-
export declare function bumpVersionAsync({ bumpStrategy, projectDir, exp,
|
|
11
|
+
export declare function bumpVersionAsync({ bumpStrategy, projectDir, exp, targets, }: {
|
|
9
12
|
projectDir: string;
|
|
10
13
|
exp: ExpoConfig;
|
|
11
14
|
bumpStrategy: BumpStrategy;
|
|
12
|
-
|
|
15
|
+
targets: Target[];
|
|
13
16
|
}): Promise<void>;
|
|
14
17
|
export declare function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, exp, }: {
|
|
15
18
|
bumpStrategy: BumpStrategy;
|
|
@@ -18,9 +21,26 @@ export declare function bumpVersionInAppJsonAsync({ bumpStrategy, projectDir, ex
|
|
|
18
21
|
}): Promise<void>;
|
|
19
22
|
export declare function readShortVersionAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings']): Promise<string | undefined>;
|
|
20
23
|
export declare function readBuildNumberAsync(projectDir: string, exp: ExpoConfig, buildSettings: XCBuildConfiguration['buildSettings']): Promise<string | undefined>;
|
|
21
|
-
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig,
|
|
24
|
+
export declare function maybeResolveVersionsAsync(projectDir: string, exp: ExpoConfig, targets: Target[]): Promise<{
|
|
22
25
|
appVersion?: string;
|
|
23
26
|
appBuildVersion?: string;
|
|
24
27
|
}>;
|
|
25
28
|
export declare function getInfoPlistPath(projectDir: string, buildSettings: XCBuildConfiguration['buildSettings']): string;
|
|
29
|
+
export declare function updateNativeVersionsAsync({ projectDir, version, buildNumber, targets, }: {
|
|
30
|
+
projectDir: string;
|
|
31
|
+
version?: string;
|
|
32
|
+
buildNumber?: string;
|
|
33
|
+
targets: Target[];
|
|
34
|
+
}): Promise<void>;
|
|
26
35
|
export declare function evaluateTemplateString(s: string, buildSettings: XCBuildConfiguration['buildSettings']): string;
|
|
36
|
+
/**
|
|
37
|
+
* Returns buildNumber that will be used for the next build. If current build profile
|
|
38
|
+
* has an 'autoIncrement' option set, it increments the version on server.
|
|
39
|
+
*/
|
|
40
|
+
export declare function resolveRemoteBuildNumberAsync({ projectDir, projectId, exp, applicationTarget, buildProfile, }: {
|
|
41
|
+
projectDir: string;
|
|
42
|
+
projectId: string;
|
|
43
|
+
exp: ExpoConfig;
|
|
44
|
+
applicationTarget: Target;
|
|
45
|
+
buildProfile: BuildProfile<Platform.IOS>;
|
|
46
|
+
}): Promise<string>;
|