eas-cli 2.8.0 → 3.0.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 +152 -53
- package/build/build/build.d.ts +1 -1
- package/build/build/runBuildAndSubmit.js +31 -2
- package/build/commands/build/run.d.ts +0 -1
- package/build/commands/build/run.js +18 -11
- package/build/commands/update/index.js +76 -135
- package/build/commands/update/republish.d.ts +36 -0
- package/build/commands/update/republish.js +218 -0
- package/build/graphql/generated.d.ts +66 -0
- package/build/graphql/types/Update.js +6 -0
- package/build/project/applicationIdentifier.js +6 -2
- package/build/run/android/emulator.js +4 -4
- package/build/run/ios/simulator.js +1 -1
- package/build/run/utils.d.ts +2 -0
- package/build/run/utils.js +20 -0
- package/build/utils/download.d.ts +1 -1
- package/build/utils/download.js +34 -17
- package/build/utils/paths.d.ts +7 -7
- package/build/utils/paths.js +3 -1
- package/oclif.manifest.json +1 -1
- package/package.json +3 -3
|
@@ -2784,7 +2784,9 @@ export declare type PublicArtifacts = {
|
|
|
2784
2784
|
export declare type PublishUpdateGroupInput = {
|
|
2785
2785
|
awaitingCodeSigningInfo?: InputMaybe<Scalars['Boolean']>;
|
|
2786
2786
|
branchId: Scalars['String'];
|
|
2787
|
+
excludedAssets?: InputMaybe<Array<PartialManifestAsset>>;
|
|
2787
2788
|
gitCommitHash?: InputMaybe<Scalars['String']>;
|
|
2789
|
+
isGitWorkingTreeDirty?: InputMaybe<Scalars['Boolean']>;
|
|
2788
2790
|
message?: InputMaybe<Scalars['String']>;
|
|
2789
2791
|
runtimeVersion: Scalars['String'];
|
|
2790
2792
|
updateInfoGroup: UpdateInfoGroup;
|
|
@@ -3358,6 +3360,7 @@ export declare type Update = ActivityTimelineProjectActivity & {
|
|
|
3358
3360
|
gitCommitHash?: Maybe<Scalars['String']>;
|
|
3359
3361
|
group: Scalars['String'];
|
|
3360
3362
|
id: Scalars['ID'];
|
|
3363
|
+
isGitWorkingTreeDirty: Scalars['Boolean'];
|
|
3361
3364
|
manifestFragment: Scalars['String'];
|
|
3362
3365
|
manifestPermalink: Scalars['String'];
|
|
3363
3366
|
message?: Maybe<Scalars['String']>;
|
|
@@ -7229,6 +7232,7 @@ export declare type BranchesByAppQuery = {
|
|
|
7229
7232
|
runtimeVersion: string;
|
|
7230
7233
|
platform: string;
|
|
7231
7234
|
manifestFragment: string;
|
|
7235
|
+
gitCommitHash?: string | null;
|
|
7232
7236
|
actor?: {
|
|
7233
7237
|
__typename: 'Robot';
|
|
7234
7238
|
firstName?: string | null;
|
|
@@ -7243,6 +7247,12 @@ export declare type BranchesByAppQuery = {
|
|
|
7243
7247
|
id: string;
|
|
7244
7248
|
name: string;
|
|
7245
7249
|
};
|
|
7250
|
+
codeSigningInfo?: {
|
|
7251
|
+
__typename?: 'CodeSigningInfo';
|
|
7252
|
+
keyid: string;
|
|
7253
|
+
sig: string;
|
|
7254
|
+
alg: string;
|
|
7255
|
+
} | null;
|
|
7246
7256
|
}>;
|
|
7247
7257
|
}>;
|
|
7248
7258
|
};
|
|
@@ -7277,6 +7287,7 @@ export declare type ViewBranchesOnUpdateChannelQuery = {
|
|
|
7277
7287
|
runtimeVersion: string;
|
|
7278
7288
|
platform: string;
|
|
7279
7289
|
manifestFragment: string;
|
|
7290
|
+
gitCommitHash?: string | null;
|
|
7280
7291
|
actor?: {
|
|
7281
7292
|
__typename: 'Robot';
|
|
7282
7293
|
firstName?: string | null;
|
|
@@ -7291,6 +7302,12 @@ export declare type ViewBranchesOnUpdateChannelQuery = {
|
|
|
7291
7302
|
id: string;
|
|
7292
7303
|
name: string;
|
|
7293
7304
|
};
|
|
7305
|
+
codeSigningInfo?: {
|
|
7306
|
+
__typename?: 'CodeSigningInfo';
|
|
7307
|
+
keyid: string;
|
|
7308
|
+
sig: string;
|
|
7309
|
+
alg: string;
|
|
7310
|
+
} | null;
|
|
7294
7311
|
}>>;
|
|
7295
7312
|
}>;
|
|
7296
7313
|
} | null;
|
|
@@ -7575,6 +7592,7 @@ export declare type ViewUpdateChannelOnAppQuery = {
|
|
|
7575
7592
|
runtimeVersion: string;
|
|
7576
7593
|
platform: string;
|
|
7577
7594
|
manifestFragment: string;
|
|
7595
|
+
gitCommitHash?: string | null;
|
|
7578
7596
|
actor?: {
|
|
7579
7597
|
__typename: 'Robot';
|
|
7580
7598
|
firstName?: string | null;
|
|
@@ -7589,6 +7607,12 @@ export declare type ViewUpdateChannelOnAppQuery = {
|
|
|
7589
7607
|
id: string;
|
|
7590
7608
|
name: string;
|
|
7591
7609
|
};
|
|
7610
|
+
codeSigningInfo?: {
|
|
7611
|
+
__typename?: 'CodeSigningInfo';
|
|
7612
|
+
keyid: string;
|
|
7613
|
+
sig: string;
|
|
7614
|
+
alg: string;
|
|
7615
|
+
} | null;
|
|
7592
7616
|
}>>;
|
|
7593
7617
|
}>;
|
|
7594
7618
|
} | null;
|
|
@@ -7625,6 +7649,7 @@ export declare type ViewUpdateChannelsOnAppQuery = {
|
|
|
7625
7649
|
runtimeVersion: string;
|
|
7626
7650
|
platform: string;
|
|
7627
7651
|
manifestFragment: string;
|
|
7652
|
+
gitCommitHash?: string | null;
|
|
7628
7653
|
actor?: {
|
|
7629
7654
|
__typename: 'Robot';
|
|
7630
7655
|
firstName?: string | null;
|
|
@@ -7639,6 +7664,12 @@ export declare type ViewUpdateChannelsOnAppQuery = {
|
|
|
7639
7664
|
id: string;
|
|
7640
7665
|
name: string;
|
|
7641
7666
|
};
|
|
7667
|
+
codeSigningInfo?: {
|
|
7668
|
+
__typename?: 'CodeSigningInfo';
|
|
7669
|
+
keyid: string;
|
|
7670
|
+
sig: string;
|
|
7671
|
+
alg: string;
|
|
7672
|
+
} | null;
|
|
7642
7673
|
}>>;
|
|
7643
7674
|
}>;
|
|
7644
7675
|
}>;
|
|
@@ -7835,6 +7866,7 @@ export declare type ViewUpdatesByGroupQuery = {
|
|
|
7835
7866
|
runtimeVersion: string;
|
|
7836
7867
|
platform: string;
|
|
7837
7868
|
manifestFragment: string;
|
|
7869
|
+
gitCommitHash?: string | null;
|
|
7838
7870
|
actor?: {
|
|
7839
7871
|
__typename: 'Robot';
|
|
7840
7872
|
firstName?: string | null;
|
|
@@ -7849,6 +7881,12 @@ export declare type ViewUpdatesByGroupQuery = {
|
|
|
7849
7881
|
id: string;
|
|
7850
7882
|
name: string;
|
|
7851
7883
|
};
|
|
7884
|
+
codeSigningInfo?: {
|
|
7885
|
+
__typename?: 'CodeSigningInfo';
|
|
7886
|
+
keyid: string;
|
|
7887
|
+
sig: string;
|
|
7888
|
+
alg: string;
|
|
7889
|
+
} | null;
|
|
7852
7890
|
}>;
|
|
7853
7891
|
};
|
|
7854
7892
|
export declare type ViewUpdateGroupsOnBranchQueryVariables = Exact<{
|
|
@@ -7877,6 +7915,7 @@ export declare type ViewUpdateGroupsOnBranchQuery = {
|
|
|
7877
7915
|
runtimeVersion: string;
|
|
7878
7916
|
platform: string;
|
|
7879
7917
|
manifestFragment: string;
|
|
7918
|
+
gitCommitHash?: string | null;
|
|
7880
7919
|
actor?: {
|
|
7881
7920
|
__typename: 'Robot';
|
|
7882
7921
|
firstName?: string | null;
|
|
@@ -7891,6 +7930,12 @@ export declare type ViewUpdateGroupsOnBranchQuery = {
|
|
|
7891
7930
|
id: string;
|
|
7892
7931
|
name: string;
|
|
7893
7932
|
};
|
|
7933
|
+
codeSigningInfo?: {
|
|
7934
|
+
__typename?: 'CodeSigningInfo';
|
|
7935
|
+
keyid: string;
|
|
7936
|
+
sig: string;
|
|
7937
|
+
alg: string;
|
|
7938
|
+
} | null;
|
|
7894
7939
|
}>>;
|
|
7895
7940
|
} | null;
|
|
7896
7941
|
};
|
|
@@ -7918,6 +7963,7 @@ export declare type ViewUpdateGroupsOnAppQuery = {
|
|
|
7918
7963
|
runtimeVersion: string;
|
|
7919
7964
|
platform: string;
|
|
7920
7965
|
manifestFragment: string;
|
|
7966
|
+
gitCommitHash?: string | null;
|
|
7921
7967
|
actor?: {
|
|
7922
7968
|
__typename: 'Robot';
|
|
7923
7969
|
firstName?: string | null;
|
|
@@ -7932,6 +7978,12 @@ export declare type ViewUpdateGroupsOnAppQuery = {
|
|
|
7932
7978
|
id: string;
|
|
7933
7979
|
name: string;
|
|
7934
7980
|
};
|
|
7981
|
+
codeSigningInfo?: {
|
|
7982
|
+
__typename?: 'CodeSigningInfo';
|
|
7983
|
+
keyid: string;
|
|
7984
|
+
sig: string;
|
|
7985
|
+
alg: string;
|
|
7986
|
+
} | null;
|
|
7935
7987
|
}>>;
|
|
7936
7988
|
};
|
|
7937
7989
|
};
|
|
@@ -8298,6 +8350,7 @@ export declare type UpdateFragment = {
|
|
|
8298
8350
|
runtimeVersion: string;
|
|
8299
8351
|
platform: string;
|
|
8300
8352
|
manifestFragment: string;
|
|
8353
|
+
gitCommitHash?: string | null;
|
|
8301
8354
|
actor?: {
|
|
8302
8355
|
__typename: 'Robot';
|
|
8303
8356
|
firstName?: string | null;
|
|
@@ -8312,6 +8365,12 @@ export declare type UpdateFragment = {
|
|
|
8312
8365
|
id: string;
|
|
8313
8366
|
name: string;
|
|
8314
8367
|
};
|
|
8368
|
+
codeSigningInfo?: {
|
|
8369
|
+
__typename?: 'CodeSigningInfo';
|
|
8370
|
+
keyid: string;
|
|
8371
|
+
sig: string;
|
|
8372
|
+
alg: string;
|
|
8373
|
+
} | null;
|
|
8315
8374
|
};
|
|
8316
8375
|
export declare type UpdateBranchFragment = {
|
|
8317
8376
|
__typename?: 'UpdateBranch';
|
|
@@ -8326,6 +8385,7 @@ export declare type UpdateBranchFragment = {
|
|
|
8326
8385
|
runtimeVersion: string;
|
|
8327
8386
|
platform: string;
|
|
8328
8387
|
manifestFragment: string;
|
|
8388
|
+
gitCommitHash?: string | null;
|
|
8329
8389
|
actor?: {
|
|
8330
8390
|
__typename: 'Robot';
|
|
8331
8391
|
firstName?: string | null;
|
|
@@ -8340,6 +8400,12 @@ export declare type UpdateBranchFragment = {
|
|
|
8340
8400
|
id: string;
|
|
8341
8401
|
name: string;
|
|
8342
8402
|
};
|
|
8403
|
+
codeSigningInfo?: {
|
|
8404
|
+
__typename?: 'CodeSigningInfo';
|
|
8405
|
+
keyid: string;
|
|
8406
|
+
sig: string;
|
|
8407
|
+
alg: string;
|
|
8408
|
+
} | null;
|
|
8343
8409
|
}>;
|
|
8344
8410
|
};
|
|
8345
8411
|
export declare type WebhookFragment = {
|
|
@@ -12,6 +12,7 @@ exports.UpdateFragmentNode = (0, graphql_tag_1.default) `
|
|
|
12
12
|
runtimeVersion
|
|
13
13
|
platform
|
|
14
14
|
manifestFragment
|
|
15
|
+
gitCommitHash
|
|
15
16
|
actor {
|
|
16
17
|
__typename
|
|
17
18
|
id
|
|
@@ -26,5 +27,10 @@ exports.UpdateFragmentNode = (0, graphql_tag_1.default) `
|
|
|
26
27
|
id
|
|
27
28
|
name
|
|
28
29
|
}
|
|
30
|
+
codeSigningInfo {
|
|
31
|
+
keyid
|
|
32
|
+
sig
|
|
33
|
+
alg
|
|
34
|
+
}
|
|
29
35
|
}
|
|
30
36
|
`;
|
|
@@ -12,14 +12,18 @@ async function getApplicationIdentifierAsync(projectDir, exp, buildProfile, plat
|
|
|
12
12
|
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
13
13
|
const profile = buildProfile;
|
|
14
14
|
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
|
|
15
|
-
const gradleContext = await (0, gradle_1.resolveGradleBuildContextAsync)(projectDir, profile);
|
|
16
15
|
if (workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
17
|
-
await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(projectDir, exp, actor);
|
|
16
|
+
return await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(projectDir, exp, actor);
|
|
18
17
|
}
|
|
18
|
+
const gradleContext = await (0, gradle_1.resolveGradleBuildContextAsync)(projectDir, profile);
|
|
19
19
|
return await (0, applicationId_1.getApplicationIdAsync)(projectDir, exp, gradleContext);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
+
const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
|
|
22
23
|
const profile = buildProfile;
|
|
24
|
+
if (workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
25
|
+
return await (0, bundleIdentifier_1.ensureBundleIdentifierIsDefinedForManagedProjectAsync)(projectDir, exp, actor);
|
|
26
|
+
}
|
|
23
27
|
const xcodeBuildContext = await (0, scheme_1.resolveXcodeBuildContextAsync)({ exp, projectDir, nonInteractive: false }, profile);
|
|
24
28
|
const targets = await (0, target_1.resolveTargetsAsync)({
|
|
25
29
|
projectDir,
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.startAppAsync = exports.installAppAsync = exports.ensureEmulatorBootedAsync = exports.selectEmulatorAsync = exports.getEmulatorExecutableAsync = exports.EMULATOR_MAX_WAIT_TIMEOUT_MS = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
|
|
6
|
+
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
7
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const node_assert_1 = tslib_1.__importDefault(require("node:assert"));
|
|
8
8
|
const os_1 = tslib_1.__importDefault(require("os"));
|
|
9
9
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
10
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
@@ -93,7 +93,7 @@ exports.ensureEmulatorBootedAsync = ensureEmulatorBootedAsync;
|
|
|
93
93
|
async function installAppAsync(emulator, apkFilePath) {
|
|
94
94
|
log_1.default.newLine();
|
|
95
95
|
log_1.default.log('Installing your app...');
|
|
96
|
-
(0,
|
|
96
|
+
(0, assert_1.default)(emulator.pid);
|
|
97
97
|
await (0, adb_1.adbAsync)('-s', emulator.pid, 'install', '-r', '-d', apkFilePath);
|
|
98
98
|
log_1.default.succeed('Successfully installed your app!');
|
|
99
99
|
}
|
|
@@ -101,8 +101,8 @@ exports.installAppAsync = installAppAsync;
|
|
|
101
101
|
async function startAppAsync(emulator, packageName, activityName) {
|
|
102
102
|
log_1.default.newLine();
|
|
103
103
|
log_1.default.log('Starting your app...');
|
|
104
|
-
(0,
|
|
105
|
-
await (0, adb_1.adbAsync)('-s', emulator.pid, 'shell', 'am', 'start', '-a', 'android.intent.action.
|
|
104
|
+
(0, assert_1.default)(emulator.pid);
|
|
105
|
+
await (0, adb_1.adbAsync)('-s', emulator.pid, 'shell', 'am', 'start', '-a', 'android.intent.action.MAIN', '-f', '0x20000000', // FLAG_ACTIVITY_SINGLE_TOP -- If set, the activity will not be launched if it is already running at the top of the history stack.
|
|
106
106
|
'-n', `${packageName}/${activityName}`);
|
|
107
107
|
log_1.default.succeed('Successfully started your app!');
|
|
108
108
|
}
|
|
@@ -20,7 +20,7 @@ async function selectSimulatorAsync() {
|
|
|
20
20
|
message: `Select a simulator to run your app on`,
|
|
21
21
|
name: 'selectedSimulator',
|
|
22
22
|
choices: simulators.map(simulator => ({
|
|
23
|
-
title: `
|
|
23
|
+
title: `iOS ${simulator.osVersion} ${simulator.name}`,
|
|
24
24
|
value: simulator,
|
|
25
25
|
})),
|
|
26
26
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isRunnableOnSimulatorOrEmulator = void 0;
|
|
4
|
+
const generated_1 = require("../graphql/generated");
|
|
5
|
+
function isAab(build) {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
return (_c = (_b = (_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.applicationArchiveUrl) === null || _b === void 0 ? void 0 : _b.endsWith('.aab')) !== null && _c !== void 0 ? _c : false;
|
|
8
|
+
}
|
|
9
|
+
function didArtifactsExpire(build) {
|
|
10
|
+
return new Date().getTime() - new Date(build.updatedAt).getTime() > 30 * 24 * 60 * 60 * 1000; // 30 days
|
|
11
|
+
}
|
|
12
|
+
function isRunnableOnSimulatorOrEmulator(build) {
|
|
13
|
+
var _a;
|
|
14
|
+
return (build.status === generated_1.BuildStatus.Finished &&
|
|
15
|
+
!!((_a = build.artifacts) === null || _a === void 0 ? void 0 : _a.applicationArchiveUrl) &&
|
|
16
|
+
((build.platform === generated_1.AppPlatform.Ios && build.distribution === generated_1.DistributionType.Simulator) ||
|
|
17
|
+
(build.platform === generated_1.AppPlatform.Android && !isAab(build))) &&
|
|
18
|
+
!didArtifactsExpire(build));
|
|
19
|
+
}
|
|
20
|
+
exports.isRunnableOnSimulatorOrEmulator = isRunnableOnSimulatorOrEmulator;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { AppPlatform } from '../graphql/generated';
|
|
2
|
-
export declare function downloadAndMaybeExtractAppAsync(url: string, platform: AppPlatform): Promise<string>;
|
|
2
|
+
export declare function downloadAndMaybeExtractAppAsync(url: string, platform: AppPlatform, cachedAppPath?: string): Promise<string>;
|
|
3
3
|
export declare function extractAppFromLocalArchiveAsync(appArchivePath: string, platform: AppPlatform): Promise<string>;
|
package/build/utils/download.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.extractAppFromLocalArchiveAsync = exports.downloadAndMaybeExtractAppAsyn
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
|
|
6
6
|
const fast_glob_1 = tslib_1.__importDefault(require("fast-glob"));
|
|
7
|
-
const
|
|
7
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
8
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
9
|
const stream_1 = require("stream");
|
|
10
10
|
const tar_1 = require("tar");
|
|
@@ -17,8 +17,8 @@ const files_1 = require("./files");
|
|
|
17
17
|
const paths_1 = require("./paths");
|
|
18
18
|
const progress_1 = require("./progress");
|
|
19
19
|
const pipeline = (0, util_1.promisify)(stream_1.Stream.pipeline);
|
|
20
|
-
let didProgressBarFinish = false;
|
|
21
20
|
function wrapFetchWithProgress() {
|
|
21
|
+
let didProgressBarFinish = false;
|
|
22
22
|
return async (url, init, progressHandler) => {
|
|
23
23
|
const response = await (0, fetch_1.default)(url, init);
|
|
24
24
|
if (response.ok) {
|
|
@@ -56,38 +56,55 @@ function wrapFetchWithProgress() {
|
|
|
56
56
|
}
|
|
57
57
|
async function downloadFileWithProgressTrackerAsync(url, outputPath, progressTrackerMessage, progressTrackerCompletedMessage) {
|
|
58
58
|
log_1.default.newLine();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
try {
|
|
60
|
+
const response = await wrapFetchWithProgress()(url, {
|
|
61
|
+
timeout: 1000 * 60 * 5, // 5 minutes
|
|
62
|
+
}, (0, progress_1.createProgressTracker)({
|
|
63
|
+
message: progressTrackerMessage,
|
|
64
|
+
completedMessage: progressTrackerCompletedMessage,
|
|
65
|
+
}));
|
|
66
|
+
if (!response.ok) {
|
|
67
|
+
throw new Error(`Failed to download file from ${url}`);
|
|
68
|
+
}
|
|
69
|
+
await pipeline(response.body, fs_extra_1.default.createWriteStream(outputPath));
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (await fs_extra_1.default.pathExists(outputPath)) {
|
|
73
|
+
await fs_extra_1.default.remove(outputPath);
|
|
74
|
+
}
|
|
75
|
+
throw error;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
async function maybeCacheAppAsync(appPath, cachedAppPath) {
|
|
79
|
+
if (cachedAppPath) {
|
|
80
|
+
await fs_extra_1.default.ensureDir(path_1.default.dirname(cachedAppPath));
|
|
81
|
+
await fs_extra_1.default.move(appPath, cachedAppPath);
|
|
82
|
+
return cachedAppPath;
|
|
67
83
|
}
|
|
68
|
-
|
|
84
|
+
return appPath;
|
|
69
85
|
}
|
|
70
|
-
async function downloadAndMaybeExtractAppAsync(url, platform) {
|
|
86
|
+
async function downloadAndMaybeExtractAppAsync(url, platform, cachedAppPath) {
|
|
71
87
|
const outputDir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
|
|
72
|
-
await
|
|
88
|
+
await fs_extra_1.default.promises.mkdir(outputDir, { recursive: true });
|
|
73
89
|
if (url.endsWith('apk')) {
|
|
74
90
|
const apkFilePath = path_1.default.join(outputDir, `${(0, uuid_1.v4)()}.apk`);
|
|
75
91
|
await downloadFileWithProgressTrackerAsync(url, apkFilePath, (ratio, total) => `Downloading app (${(0, files_1.formatBytes)(total * ratio)} / ${(0, files_1.formatBytes)(total)})`, 'Successfully downloaded app');
|
|
76
|
-
return apkFilePath;
|
|
92
|
+
return maybeCacheAppAsync(apkFilePath, cachedAppPath);
|
|
77
93
|
}
|
|
78
94
|
else {
|
|
79
95
|
const tmpArchivePathDir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
|
|
80
|
-
await
|
|
96
|
+
await fs_extra_1.default.mkdir(tmpArchivePathDir, { recursive: true });
|
|
81
97
|
const tmpArchivePath = path_1.default.join(tmpArchivePathDir, `${(0, uuid_1.v4)()}.tar.gz`);
|
|
82
98
|
await downloadFileWithProgressTrackerAsync(url, tmpArchivePath, (ratio, total) => `Downloading app archive (${(0, files_1.formatBytes)(total * ratio)} / ${(0, files_1.formatBytes)(total)})`, 'Successfully downloaded app archive');
|
|
83
99
|
await tarExtractAsync(tmpArchivePath, outputDir);
|
|
84
|
-
|
|
100
|
+
const appPath = await getAppPathAsync(outputDir, platform === generated_1.AppPlatform.Ios ? 'app' : 'apk');
|
|
101
|
+
return maybeCacheAppAsync(appPath, cachedAppPath);
|
|
85
102
|
}
|
|
86
103
|
}
|
|
87
104
|
exports.downloadAndMaybeExtractAppAsync = downloadAndMaybeExtractAppAsync;
|
|
88
105
|
async function extractAppFromLocalArchiveAsync(appArchivePath, platform) {
|
|
89
106
|
const outputDir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
|
|
90
|
-
await
|
|
107
|
+
await fs_extra_1.default.promises.mkdir(outputDir, { recursive: true });
|
|
91
108
|
await tarExtractAsync(appArchivePath, outputDir);
|
|
92
109
|
return await getAppPathAsync(outputDir, platform === generated_1.AppPlatform.Android ? 'apk' : 'app');
|
|
93
110
|
}
|
package/build/utils/paths.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
declare const getStateJsonPath: () => string;
|
|
2
|
-
declare const
|
|
3
|
-
declare const
|
|
4
|
-
declare const
|
|
5
|
-
declare const
|
|
6
|
-
declare const
|
|
7
|
-
export
|
|
1
|
+
export declare const getStateJsonPath: () => string;
|
|
2
|
+
export declare const getEasBuildRunCacheDirectoryPath: () => string;
|
|
3
|
+
export declare const getDataDirectory: () => string;
|
|
4
|
+
export declare const getConfigDirectory: () => string;
|
|
5
|
+
export declare const getCacheDirectory: () => string;
|
|
6
|
+
export declare const getLogDirectory: () => string;
|
|
7
|
+
export declare const getTmpDirectory: () => string;
|
package/build/utils/paths.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getTmpDirectory = exports.getLogDirectory = exports.getCacheDirectory = exports.getConfigDirectory = exports.getDataDirectory = exports.getEasBuildRunCacheDirectoryPath = exports.getStateJsonPath = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const env_paths_1 = tslib_1.__importDefault(require("env-paths"));
|
|
6
6
|
const os_1 = require("os");
|
|
@@ -26,6 +26,8 @@ function dotExpoHomeDirectory() {
|
|
|
26
26
|
}
|
|
27
27
|
const getStateJsonPath = () => path.join(dotExpoHomeDirectory(), 'state.json');
|
|
28
28
|
exports.getStateJsonPath = getStateJsonPath;
|
|
29
|
+
const getEasBuildRunCacheDirectoryPath = () => path.join((0, exports.getTmpDirectory)(), 'eas-build-run-cache');
|
|
30
|
+
exports.getEasBuildRunCacheDirectoryPath = getEasBuildRunCacheDirectoryPath;
|
|
29
31
|
// Paths for storing things like data, config, cache, etc.
|
|
30
32
|
// Should use the correct OS-specific paths (e.g. XDG base directory on Linux)
|
|
31
33
|
const { data: DATA_PATH, config: CONFIG_PATH, cache: CACHE_PATH, log: LOG_PATH, temp: TEMP_PATH, } = (0, env_paths_1.default)('eas-cli');
|