@expo/build-tools 1.0.272 → 18.0.1
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/LICENSE +21 -100
- package/README.md +1 -1
- package/dist/android/credentials.js +2 -3
- package/dist/android/expoUpdates.js +5 -8
- package/dist/android/gradle.js +6 -8
- package/dist/android/gradleConfig.js +2 -3
- package/dist/buildErrors/buildErrorHandlers.js +4 -3
- package/dist/buildErrors/detectError.js +11 -11
- package/dist/buildErrors/errors.types.js +0 -1
- package/dist/buildErrors/userErrorHandlers.js +2 -3
- package/dist/builders/android.js +19 -24
- package/dist/builders/common.js +0 -1
- package/dist/builders/custom.js +9 -11
- package/dist/builders/index.js +0 -1
- package/dist/builders/ios.js +24 -29
- package/dist/common/eagerBundle.js +3 -4
- package/dist/common/easBuildInternal.js +5 -7
- package/dist/common/fastlane.js +0 -1
- package/dist/common/git.js +0 -1
- package/dist/common/installDependencies.d.ts +1 -1
- package/dist/common/installDependencies.js +1 -2
- package/dist/common/prebuild.js +3 -5
- package/dist/common/projectSources.js +12 -16
- package/dist/common/setup.js +28 -33
- package/dist/context.d.ts +1 -1
- package/dist/context.js +33 -25
- package/dist/customBuildContext.d.ts +1 -1
- package/dist/customBuildContext.js +32 -10
- package/dist/gcs/LoggerStream.d.ts +1 -1
- package/dist/gcs/LoggerStream.js +22 -14
- package/dist/gcs/__unit__/gcs.test.js +5 -8
- package/dist/gcs/client.d.ts +1 -1
- package/dist/gcs/client.js +28 -19
- package/dist/gcs/retry.js +4 -5
- package/dist/generic.d.ts +1 -1
- package/dist/generic.js +5 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +19 -10
- package/dist/ios/configure.d.ts +1 -1
- package/dist/ios/configure.js +9 -11
- package/dist/ios/credentials/distributionCertificate.js +1 -3
- package/dist/ios/credentials/keychain.js +9 -8
- package/dist/ios/credentials/manager.d.ts +1 -1
- package/dist/ios/credentials/manager.js +24 -13
- package/dist/ios/credentials/provisioningProfile.js +12 -6
- package/dist/ios/expoUpdates.js +7 -11
- package/dist/ios/fastfile.d.ts +1 -1
- package/dist/ios/fastfile.js +0 -1
- package/dist/ios/fastlane.d.ts +1 -1
- package/dist/ios/fastlane.js +8 -9
- package/dist/ios/gymfile.d.ts +1 -1
- package/dist/ios/gymfile.js +1 -2
- package/dist/ios/pod.js +1 -2
- package/dist/ios/resign.js +3 -5
- package/dist/ios/resolve.js +1 -2
- package/dist/ios/tvos.js +1 -3
- package/dist/ios/xcodeBuildLogs.d.ts +1 -1
- package/dist/ios/xcodeBuildLogs.js +5 -7
- package/dist/ios/xcodeEnv.js +1 -2
- package/dist/ios/xcpretty.js +11 -7
- package/dist/steps/easFunctionGroups.js +0 -1
- package/dist/steps/easFunctions.js +26 -25
- package/dist/steps/functionGroups/build.d.ts +1 -1
- package/dist/steps/functionGroups/build.js +24 -26
- package/dist/steps/functionGroups/maestroTest.js +7 -9
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +6 -9
- package/dist/steps/functions/ccacheStats.js +4 -6
- package/dist/steps/functions/checkout.js +0 -1
- package/dist/steps/functions/configureAndroidVersion.js +3 -5
- package/dist/steps/functions/configureEASUpdateIfInstalled.js +4 -6
- package/dist/steps/functions/configureIosCredentials.js +3 -4
- package/dist/steps/functions/configureIosVersion.js +4 -6
- package/dist/steps/functions/createSubmissionEntity.js +2 -4
- package/dist/steps/functions/downloadArtifact.d.ts +1 -1
- package/dist/steps/functions/downloadArtifact.js +7 -9
- package/dist/steps/functions/downloadBuild.d.ts +1 -1
- package/dist/steps/functions/downloadBuild.js +10 -12
- package/dist/steps/functions/eagerBundle.js +2 -4
- package/dist/steps/functions/findAndUploadBuildArtifacts.js +5 -8
- package/dist/steps/functions/generateGymfileFromTemplate.js +6 -8
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js +0 -1
- package/dist/steps/functions/injectAndroidCredentials.js +3 -4
- package/dist/steps/functions/installMaestro.js +3 -4
- package/dist/steps/functions/installNodeModules.d.ts +1 -1
- package/dist/steps/functions/installNodeModules.js +12 -12
- package/dist/steps/functions/installPods.js +0 -1
- package/dist/steps/functions/internalMaestroTest.js +16 -16
- package/dist/steps/functions/prebuild.js +3 -5
- package/dist/steps/functions/repack.d.ts +1 -1
- package/dist/steps/functions/repack.js +25 -19
- package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js +1 -2
- package/dist/steps/functions/resolveBuildConfig.js +0 -1
- package/dist/steps/functions/restoreBuildCache.d.ts +1 -1
- package/dist/steps/functions/restoreBuildCache.js +8 -10
- package/dist/steps/functions/restoreCache.d.ts +1 -1
- package/dist/steps/functions/restoreCache.js +34 -26
- package/dist/steps/functions/runFastlane.js +0 -1
- package/dist/steps/functions/runGradle.js +2 -3
- package/dist/steps/functions/saveBuildCache.d.ts +1 -1
- package/dist/steps/functions/saveBuildCache.js +6 -7
- package/dist/steps/functions/saveCache.d.ts +1 -1
- package/dist/steps/functions/saveCache.js +26 -18
- package/dist/steps/functions/sendSlackMessage.js +1 -3
- package/dist/steps/functions/startAndroidEmulator.js +5 -7
- package/dist/steps/functions/startCuttlefishDevice.js +32 -10
- package/dist/steps/functions/startIosSimulator.js +8 -11
- package/dist/steps/functions/uploadArtifact.js +4 -6
- package/dist/steps/functions/uploadToAsc.d.ts +2 -0
- package/dist/steps/functions/uploadToAsc.js +287 -0
- package/dist/steps/functions/useNpmToken.js +3 -4
- package/dist/steps/utils/android/expoUpdates.js +3 -5
- package/dist/steps/utils/android/gradle.d.ts +1 -1
- package/dist/steps/utils/android/gradle.js +6 -7
- package/dist/steps/utils/android/gradleConfig.js +4 -5
- package/dist/steps/utils/cache.js +0 -1
- package/dist/steps/utils/expoUpdates.d.ts +1 -1
- package/dist/steps/utils/expoUpdates.js +15 -18
- package/dist/steps/utils/ios/AscApiClient.d.ts +250 -0
- package/dist/steps/utils/ios/AscApiClient.js +299 -0
- package/dist/steps/utils/ios/configure.js +4 -5
- package/dist/steps/utils/ios/credentials/credentials.js +0 -1
- package/dist/steps/utils/ios/credentials/distributionCertificate.js +1 -3
- package/dist/steps/utils/ios/credentials/keychain.js +8 -8
- package/dist/steps/utils/ios/credentials/manager.js +24 -13
- package/dist/steps/utils/ios/credentials/provisioningProfile.js +11 -6
- package/dist/steps/utils/ios/expoUpdates.js +4 -7
- package/dist/steps/utils/ios/fastlane.d.ts +1 -1
- package/dist/steps/utils/ios/fastlane.js +3 -4
- package/dist/steps/utils/ios/resolve.js +1 -2
- package/dist/steps/utils/ios/tvos.js +1 -3
- package/dist/steps/utils/ios/xcpretty.js +11 -7
- package/dist/steps/utils/slackMessageDynamicFields.js +0 -1
- package/dist/templates/EasBuildConfigureVersionGradle.js +0 -1
- package/dist/templates/EasBuildGradle.js +0 -1
- package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js +0 -1
- package/dist/templates/FastfileResign.js +0 -1
- package/dist/templates/GymfileArchive.js +0 -1
- package/dist/templates/GymfileSimulator.js +0 -1
- package/dist/templates/npmrc.js +0 -1
- package/dist/utils/AndroidEmulatorUtils.js +20 -22
- package/dist/utils/IosSimulatorUtils.js +9 -11
- package/dist/utils/appConfig.js +1 -2
- package/dist/utils/artifacts.d.ts +1 -1
- package/dist/utils/artifacts.js +7 -8
- package/dist/utils/cacheKey.js +21 -12
- package/dist/utils/diffFingerprintsAsync.d.ts +1 -1
- package/dist/utils/diffFingerprintsAsync.js +0 -1
- package/dist/utils/environmentSecrets.js +3 -4
- package/dist/utils/expoFingerprintCli.js +5 -6
- package/dist/utils/expoUpdates.d.ts +1 -2
- package/dist/utils/expoUpdates.js +19 -33
- package/dist/utils/expoUpdatesCli.js +20 -11
- package/dist/utils/files.js +23 -15
- package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js +27 -21
- package/dist/utils/fingerprint.js +0 -1
- package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js +0 -1
- package/dist/utils/hooks.js +1 -3
- package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.d.ts +1 -0
- package/dist/utils/isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported.js +14 -0
- package/dist/utils/npmrc.js +2 -3
- package/dist/utils/outputs.d.ts +1 -1
- package/dist/utils/outputs.js +2 -5
- package/dist/utils/packageManager.js +22 -14
- package/dist/utils/prepareBuildExecutable.js +1 -2
- package/dist/utils/processes.js +2 -3
- package/dist/utils/project.js +1 -2
- package/dist/utils/promiseRetryWithCondition.js +0 -1
- package/dist/utils/resolveRuntimeVersionAsync.d.ts +1 -1
- package/dist/utils/resolveRuntimeVersionAsync.js +4 -6
- package/dist/utils/retry.js +2 -3
- package/dist/utils/retryOnDNSFailure.js +0 -1
- package/dist/utils/stepMetrics.d.ts +1 -1
- package/dist/utils/stepMetrics.js +0 -1
- package/dist/utils/strings.js +1 -3
- package/dist/utils/turtleFetch.d.ts +1 -1
- package/dist/utils/turtleFetch.js +2 -2
- package/package.json +25 -22
- package/dist/android/credentials.js.map +0 -1
- package/dist/android/expoUpdates.js.map +0 -1
- package/dist/android/gradle.js.map +0 -1
- package/dist/android/gradleConfig.js.map +0 -1
- package/dist/buildErrors/buildErrorHandlers.js.map +0 -1
- package/dist/buildErrors/detectError.js.map +0 -1
- package/dist/buildErrors/errors.types.js.map +0 -1
- package/dist/buildErrors/userErrorHandlers.js.map +0 -1
- package/dist/builders/android.js.map +0 -1
- package/dist/builders/common.js.map +0 -1
- package/dist/builders/custom.js.map +0 -1
- package/dist/builders/index.js.map +0 -1
- package/dist/builders/ios.js.map +0 -1
- package/dist/common/eagerBundle.js.map +0 -1
- package/dist/common/easBuildInternal.js.map +0 -1
- package/dist/common/fastlane.js.map +0 -1
- package/dist/common/git.js.map +0 -1
- package/dist/common/installDependencies.js.map +0 -1
- package/dist/common/prebuild.js.map +0 -1
- package/dist/common/projectSources.js.map +0 -1
- package/dist/common/setup.js.map +0 -1
- package/dist/context.js.map +0 -1
- package/dist/customBuildContext.js.map +0 -1
- package/dist/gcs/LoggerStream.js.map +0 -1
- package/dist/gcs/__unit__/gcs.test.js.map +0 -1
- package/dist/gcs/client.js.map +0 -1
- package/dist/gcs/retry.js.map +0 -1
- package/dist/generic.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/ios/configure.js.map +0 -1
- package/dist/ios/credentials/distributionCertificate.js.map +0 -1
- package/dist/ios/credentials/keychain.js.map +0 -1
- package/dist/ios/credentials/manager.js.map +0 -1
- package/dist/ios/credentials/provisioningProfile.js.map +0 -1
- package/dist/ios/expoUpdates.js.map +0 -1
- package/dist/ios/fastfile.js.map +0 -1
- package/dist/ios/fastlane.js.map +0 -1
- package/dist/ios/gymfile.js.map +0 -1
- package/dist/ios/pod.js.map +0 -1
- package/dist/ios/resign.js.map +0 -1
- package/dist/ios/resolve.js.map +0 -1
- package/dist/ios/tvos.js.map +0 -1
- package/dist/ios/xcodeBuildLogs.js.map +0 -1
- package/dist/ios/xcodeEnv.js.map +0 -1
- package/dist/ios/xcpretty.js.map +0 -1
- package/dist/steps/easFunctionGroups.js.map +0 -1
- package/dist/steps/easFunctions.js.map +0 -1
- package/dist/steps/functionGroups/build.js.map +0 -1
- package/dist/steps/functionGroups/maestroTest.js.map +0 -1
- package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +0 -1
- package/dist/steps/functions/ccacheStats.js.map +0 -1
- package/dist/steps/functions/checkout.js.map +0 -1
- package/dist/steps/functions/configureAndroidVersion.js.map +0 -1
- package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +0 -1
- package/dist/steps/functions/configureIosCredentials.js.map +0 -1
- package/dist/steps/functions/configureIosVersion.js.map +0 -1
- package/dist/steps/functions/createSubmissionEntity.js.map +0 -1
- package/dist/steps/functions/downloadArtifact.js.map +0 -1
- package/dist/steps/functions/downloadBuild.js.map +0 -1
- package/dist/steps/functions/eagerBundle.js.map +0 -1
- package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +0 -1
- package/dist/steps/functions/generateGymfileFromTemplate.js.map +0 -1
- package/dist/steps/functions/getCredentialsForBuildTriggeredByGitHubIntegration.js.map +0 -1
- package/dist/steps/functions/injectAndroidCredentials.js.map +0 -1
- package/dist/steps/functions/installMaestro.js.map +0 -1
- package/dist/steps/functions/installNodeModules.js.map +0 -1
- package/dist/steps/functions/installPods.js.map +0 -1
- package/dist/steps/functions/internalMaestroTest.js.map +0 -1
- package/dist/steps/functions/prebuild.js.map +0 -1
- package/dist/steps/functions/repack.js.map +0 -1
- package/dist/steps/functions/resolveAppleTeamIdFromCredentials.js.map +0 -1
- package/dist/steps/functions/resolveBuildConfig.js.map +0 -1
- package/dist/steps/functions/restoreBuildCache.js.map +0 -1
- package/dist/steps/functions/restoreCache.js.map +0 -1
- package/dist/steps/functions/runFastlane.js.map +0 -1
- package/dist/steps/functions/runGradle.js.map +0 -1
- package/dist/steps/functions/saveBuildCache.js.map +0 -1
- package/dist/steps/functions/saveCache.js.map +0 -1
- package/dist/steps/functions/sendSlackMessage.js.map +0 -1
- package/dist/steps/functions/startAndroidEmulator.js.map +0 -1
- package/dist/steps/functions/startCuttlefishDevice.js.map +0 -1
- package/dist/steps/functions/startIosSimulator.js.map +0 -1
- package/dist/steps/functions/uploadArtifact.js.map +0 -1
- package/dist/steps/functions/useNpmToken.js.map +0 -1
- package/dist/steps/utils/android/expoUpdates.js.map +0 -1
- package/dist/steps/utils/android/gradle.js.map +0 -1
- package/dist/steps/utils/android/gradleConfig.js.map +0 -1
- package/dist/steps/utils/cache.js.map +0 -1
- package/dist/steps/utils/expoUpdates.js.map +0 -1
- package/dist/steps/utils/ios/configure.js.map +0 -1
- package/dist/steps/utils/ios/credentials/credentials.js.map +0 -1
- package/dist/steps/utils/ios/credentials/distributionCertificate.js.map +0 -1
- package/dist/steps/utils/ios/credentials/keychain.js.map +0 -1
- package/dist/steps/utils/ios/credentials/manager.js.map +0 -1
- package/dist/steps/utils/ios/credentials/provisioningProfile.js.map +0 -1
- package/dist/steps/utils/ios/expoUpdates.js.map +0 -1
- package/dist/steps/utils/ios/fastlane.js.map +0 -1
- package/dist/steps/utils/ios/resolve.js.map +0 -1
- package/dist/steps/utils/ios/tvos.js.map +0 -1
- package/dist/steps/utils/ios/xcpretty.js.map +0 -1
- package/dist/steps/utils/slackMessageDynamicFields.js.map +0 -1
- package/dist/templates/EasBuildConfigureVersionGradle.js.map +0 -1
- package/dist/templates/EasBuildGradle.js.map +0 -1
- package/dist/templates/EasBuildInjectAndroidCredentialsGradle.js.map +0 -1
- package/dist/templates/FastfileResign.js.map +0 -1
- package/dist/templates/GymfileArchive.js.map +0 -1
- package/dist/templates/GymfileSimulator.js.map +0 -1
- package/dist/templates/npmrc.js.map +0 -1
- package/dist/utils/AndroidEmulatorUtils.js.map +0 -1
- package/dist/utils/IosSimulatorUtils.js.map +0 -1
- package/dist/utils/appConfig.js.map +0 -1
- package/dist/utils/artifacts.js.map +0 -1
- package/dist/utils/cacheKey.js.map +0 -1
- package/dist/utils/diffFingerprintsAsync.js.map +0 -1
- package/dist/utils/environmentSecrets.js.map +0 -1
- package/dist/utils/expoFingerprintCli.js.map +0 -1
- package/dist/utils/expoUpdates.js.map +0 -1
- package/dist/utils/expoUpdatesCli.js.map +0 -1
- package/dist/utils/files.js.map +0 -1
- package/dist/utils/findMaestroPathsFlowsToExecuteAsync.js.map +0 -1
- package/dist/utils/fingerprint.js.map +0 -1
- package/dist/utils/getExpoUpdatesPackageVersionIfInstalledAsync.js.map +0 -1
- package/dist/utils/hooks.js.map +0 -1
- package/dist/utils/npmrc.js.map +0 -1
- package/dist/utils/outputs.js.map +0 -1
- package/dist/utils/packageManager.js.map +0 -1
- package/dist/utils/prepareBuildExecutable.js.map +0 -1
- package/dist/utils/processes.js.map +0 -1
- package/dist/utils/project.js.map +0 -1
- package/dist/utils/promiseRetryWithCondition.js.map +0 -1
- package/dist/utils/resolveRuntimeVersionAsync.js.map +0 -1
- package/dist/utils/retry.js.map +0 -1
- package/dist/utils/retryOnDNSFailure.js.map +0 -1
- package/dist/utils/stepMetrics.js.map +0 -1
- package/dist/utils/strings.js.map +0 -1
- package/dist/utils/turtleFetch.js.map +0 -1
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.createUploadToAscBuildFunction = createUploadToAscBuildFunction;
|
|
40
|
+
const steps_1 = require("@expo/steps");
|
|
41
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
42
|
+
const jose = __importStar(require("jose"));
|
|
43
|
+
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
44
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
45
|
+
const promises_1 = require("node:timers/promises");
|
|
46
|
+
const zod_1 = require("zod");
|
|
47
|
+
const AscApiClient_1 = require("../utils/ios/AscApiClient");
|
|
48
|
+
function createUploadToAscBuildFunction() {
|
|
49
|
+
return new steps_1.BuildFunction({
|
|
50
|
+
namespace: 'eas',
|
|
51
|
+
id: 'upload_to_asc',
|
|
52
|
+
name: 'Upload to App Store Connect',
|
|
53
|
+
__metricsId: 'eas/upload_to_asc',
|
|
54
|
+
inputProviders: [
|
|
55
|
+
steps_1.BuildStepInput.createProvider({
|
|
56
|
+
id: 'ipa_path',
|
|
57
|
+
required: true,
|
|
58
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
59
|
+
}),
|
|
60
|
+
steps_1.BuildStepInput.createProvider({
|
|
61
|
+
id: 'asc_api_key_path',
|
|
62
|
+
required: true,
|
|
63
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
64
|
+
}),
|
|
65
|
+
steps_1.BuildStepInput.createProvider({
|
|
66
|
+
id: 'apple_app_identifier',
|
|
67
|
+
required: true,
|
|
68
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
69
|
+
}),
|
|
70
|
+
steps_1.BuildStepInput.createProvider({
|
|
71
|
+
id: 'bundle_version',
|
|
72
|
+
required: true,
|
|
73
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
74
|
+
}),
|
|
75
|
+
steps_1.BuildStepInput.createProvider({
|
|
76
|
+
id: 'bundle_short_version',
|
|
77
|
+
required: true,
|
|
78
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
|
|
79
|
+
}),
|
|
80
|
+
steps_1.BuildStepInput.createProvider({
|
|
81
|
+
id: 'wait_for_processing',
|
|
82
|
+
required: false,
|
|
83
|
+
defaultValue: false,
|
|
84
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
85
|
+
}),
|
|
86
|
+
],
|
|
87
|
+
outputProviders: [
|
|
88
|
+
steps_1.BuildStepOutput.createProvider({
|
|
89
|
+
id: 'build_upload_id',
|
|
90
|
+
required: false,
|
|
91
|
+
}),
|
|
92
|
+
steps_1.BuildStepOutput.createProvider({
|
|
93
|
+
id: 'build_upload_url',
|
|
94
|
+
required: false,
|
|
95
|
+
}),
|
|
96
|
+
],
|
|
97
|
+
fn: async (stepsCtx, { inputs, outputs }) => {
|
|
98
|
+
const ipaPathInput = zod_1.z.string().parse(inputs.ipa_path.value);
|
|
99
|
+
const ascApiKeyPathInput = zod_1.z.string().parse(inputs.asc_api_key_path.value);
|
|
100
|
+
const appleAppIdentifier = zod_1.z.string().parse(inputs.apple_app_identifier.value);
|
|
101
|
+
const bundleVersion = zod_1.z.string().parse(inputs.bundle_version.value);
|
|
102
|
+
const bundleShortVersion = zod_1.z.string().parse(inputs.bundle_short_version.value);
|
|
103
|
+
const waitForProcessing = Boolean(inputs.wait_for_processing.value);
|
|
104
|
+
const ipaPath = node_path_1.default.resolve(stepsCtx.workingDirectory, ipaPathInput);
|
|
105
|
+
if (!(await fs_extra_1.default.pathExists(ipaPath))) {
|
|
106
|
+
throw new Error(`IPA file not found: ${ipaPath}`);
|
|
107
|
+
}
|
|
108
|
+
const fileSize = (await fs_extra_1.default.stat(ipaPath)).size;
|
|
109
|
+
const fileName = node_path_1.default.basename(ipaPath);
|
|
110
|
+
const ascApiKeyPath = node_path_1.default.resolve(stepsCtx.workingDirectory, ascApiKeyPathInput);
|
|
111
|
+
if (!(await fs_extra_1.default.pathExists(ascApiKeyPath))) {
|
|
112
|
+
throw new Error(`ASC API Key file not found: ${ascApiKeyPath}`);
|
|
113
|
+
}
|
|
114
|
+
const ascApiKeyJson = await fs_extra_1.default.readJson(ascApiKeyPath);
|
|
115
|
+
const ascApiKey = zod_1.z
|
|
116
|
+
.object({
|
|
117
|
+
issuer_id: zod_1.z.string(),
|
|
118
|
+
key_id: zod_1.z.string(),
|
|
119
|
+
key: zod_1.z.string(),
|
|
120
|
+
})
|
|
121
|
+
.parse(ascApiKeyJson);
|
|
122
|
+
const privateKey = await jose.importPKCS8(ascApiKey.key, 'ES256');
|
|
123
|
+
const token = await new jose.SignJWT({})
|
|
124
|
+
.setProtectedHeader({ alg: 'ES256', kid: ascApiKey.key_id })
|
|
125
|
+
.setIssuer(ascApiKey.issuer_id)
|
|
126
|
+
.setAudience('appstoreconnect-v1')
|
|
127
|
+
.setExpirationTime('20m')
|
|
128
|
+
.sign(privateKey);
|
|
129
|
+
const client = new AscApiClient_1.AscApiClient({ token, logger: stepsCtx.logger });
|
|
130
|
+
stepsCtx.logger.info('Reading App information...');
|
|
131
|
+
const appResponse = await client.getAsync('/v1/apps/:id', { 'fields[apps]': ['bundleId', 'name'] }, { id: appleAppIdentifier });
|
|
132
|
+
stepsCtx.logger.info(`Uploading Build to "${appResponse.data.attributes.name}" (${appResponse.data.attributes.bundleId})...`);
|
|
133
|
+
stepsCtx.logger.info('Creating Build Upload...');
|
|
134
|
+
const buildUploadResponse = await client.postAsync('/v1/buildUploads', {
|
|
135
|
+
data: {
|
|
136
|
+
type: 'buildUploads',
|
|
137
|
+
attributes: {
|
|
138
|
+
platform: 'IOS',
|
|
139
|
+
cfBundleShortVersionString: bundleShortVersion,
|
|
140
|
+
cfBundleVersion: bundleVersion,
|
|
141
|
+
},
|
|
142
|
+
relationships: {
|
|
143
|
+
app: {
|
|
144
|
+
data: {
|
|
145
|
+
type: 'apps',
|
|
146
|
+
id: appleAppIdentifier,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
const buildUploadId = buildUploadResponse.data.id;
|
|
153
|
+
const buildUploadUrl = `https://appstoreconnect.apple.com/apps/${appleAppIdentifier}/testflight/ios/${buildUploadId}`;
|
|
154
|
+
outputs.build_upload_id.set(buildUploadId);
|
|
155
|
+
outputs.build_upload_url.set(buildUploadUrl);
|
|
156
|
+
stepsCtx.logger.info(`Build Upload initialized (ID: ${buildUploadId}). Preparing IPA upload...`);
|
|
157
|
+
const buildFileResponse = await client.postAsync('/v1/buildUploadFiles', {
|
|
158
|
+
data: {
|
|
159
|
+
type: 'buildUploadFiles',
|
|
160
|
+
attributes: {
|
|
161
|
+
assetType: 'ASSET',
|
|
162
|
+
fileName,
|
|
163
|
+
fileSize,
|
|
164
|
+
uti: 'com.apple.ipa',
|
|
165
|
+
},
|
|
166
|
+
relationships: {
|
|
167
|
+
buildUpload: {
|
|
168
|
+
data: {
|
|
169
|
+
type: 'buildUploads',
|
|
170
|
+
id: buildUploadId,
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
stepsCtx.logger.info(`IPA Upload initialized (ID: ${buildFileResponse.data.id}). Uploading IPA...`);
|
|
177
|
+
await uploadChunksAsync({
|
|
178
|
+
uploadOperations: buildFileResponse.data.attributes.uploadOperations,
|
|
179
|
+
ipaPath,
|
|
180
|
+
logger: stepsCtx.logger,
|
|
181
|
+
});
|
|
182
|
+
stepsCtx.logger.info('Committing upload...');
|
|
183
|
+
await client.patchAsync(`/v1/buildUploadFiles/:id`, {
|
|
184
|
+
data: {
|
|
185
|
+
type: 'buildUploadFiles',
|
|
186
|
+
id: buildFileResponse.data.id,
|
|
187
|
+
attributes: {
|
|
188
|
+
uploaded: true,
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
}, {
|
|
192
|
+
id: buildFileResponse.data.id,
|
|
193
|
+
});
|
|
194
|
+
stepsCtx.logger.info('Checking upload file status...');
|
|
195
|
+
const waitingForFileStartedAt = Date.now();
|
|
196
|
+
while (Date.now() - waitingForFileStartedAt < 60 * 1000 /* 60 seconds */) {
|
|
197
|
+
const { data: { attributes: { assetDeliveryState }, }, } = await client.getAsync(`/v1/buildUploadFiles/:id`, { 'fields[buildUploadFiles]': ['assetDeliveryState'] }, { id: buildFileResponse.data.id });
|
|
198
|
+
if (assetDeliveryState.state === 'AWAITING_UPLOAD') {
|
|
199
|
+
stepsCtx.logger.info(`Waiting for file upload to complete processing... (state = ${assetDeliveryState.state})`);
|
|
200
|
+
await (0, promises_1.setTimeout)(2000);
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
const { errors = [], warnings = [] } = assetDeliveryState;
|
|
204
|
+
if (warnings.length > 0) {
|
|
205
|
+
stepsCtx.logger.warn(`Warnings:\n${itemizeMessages(warnings)}\n`);
|
|
206
|
+
}
|
|
207
|
+
if (errors.length > 0) {
|
|
208
|
+
stepsCtx.logger.error(`Errors:\n${itemizeMessages(errors)}\n`);
|
|
209
|
+
}
|
|
210
|
+
if (assetDeliveryState.state === 'FAILED') {
|
|
211
|
+
throw new Error(`File upload (ID: ${buildFileResponse.data.id}) failed.`);
|
|
212
|
+
}
|
|
213
|
+
else if (assetDeliveryState.state === 'COMPLETE' ||
|
|
214
|
+
assetDeliveryState.state === 'UPLOAD_COMPLETE') {
|
|
215
|
+
stepsCtx.logger.info(`File upload (ID: ${buildFileResponse.data.id}) completed!`);
|
|
216
|
+
}
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
stepsCtx.logger.info(`See your build in App Store Connect: ${buildUploadUrl}`);
|
|
220
|
+
if (!waitForProcessing) {
|
|
221
|
+
stepsCtx.logger.info('Skipping waiting for processing.');
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
stepsCtx.logger.info('Checking build upload status...');
|
|
225
|
+
const waitingForBuildStartedAt = Date.now();
|
|
226
|
+
while (Date.now() - waitingForBuildStartedAt < 10 * 60 * 1000 /* 10 minutes */) {
|
|
227
|
+
const { data: { attributes: { state }, }, } = await client.getAsync(`/v1/buildUploads/:id`, { 'fields[buildUploads]': ['state', 'build'], include: ['build'] }, { id: buildUploadId });
|
|
228
|
+
if (state.state === 'AWAITING_UPLOAD' || state.state === 'PROCESSING') {
|
|
229
|
+
stepsCtx.logger.info(`Waiting for build upload to complete... (status = ${state.state})`);
|
|
230
|
+
await (0, promises_1.setTimeout)(2000);
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
stepsCtx.logger.info('\n');
|
|
234
|
+
const { errors = [], warnings = [], infos = [] } = state;
|
|
235
|
+
if (infos.length > 0) {
|
|
236
|
+
stepsCtx.logger.info(`Infos:\n${itemizeMessages(infos)}\n`);
|
|
237
|
+
}
|
|
238
|
+
if (warnings.length > 0) {
|
|
239
|
+
stepsCtx.logger.warn(`Warnings:\n${itemizeMessages(warnings)}\n`);
|
|
240
|
+
}
|
|
241
|
+
if (errors.length > 0) {
|
|
242
|
+
stepsCtx.logger.error(`Errors:\n${itemizeMessages(errors)}\n`);
|
|
243
|
+
}
|
|
244
|
+
if (state.state === 'FAILED') {
|
|
245
|
+
throw new Error(`Build upload (ID: ${buildUploadId}) failed.`);
|
|
246
|
+
}
|
|
247
|
+
else if (state.state === 'COMPLETE') {
|
|
248
|
+
stepsCtx.logger.info(`Build upload (ID: ${buildUploadId}) complete!`);
|
|
249
|
+
}
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function itemizeMessages(messages) {
|
|
256
|
+
return `- ${messages.map(m => `${m.description} (${m.code})`).join('\n- ')}`;
|
|
257
|
+
}
|
|
258
|
+
async function uploadChunksAsync({ uploadOperations, ipaPath, logger, }) {
|
|
259
|
+
const fd = await fs_extra_1.default.open(ipaPath, 'r');
|
|
260
|
+
try {
|
|
261
|
+
const promises = uploadOperations.map(async (op, index) => {
|
|
262
|
+
logger.info(` Uploading chunk ${index + 1}/${uploadOperations.length} (offset: ${op.offset}, length: ${op.length})...`);
|
|
263
|
+
const buffer = new Uint8Array(op.length);
|
|
264
|
+
await fs_extra_1.default.read(fd, buffer, 0, op.length, op.offset);
|
|
265
|
+
const headers = {
|
|
266
|
+
'Content-Type': 'application/octet-stream',
|
|
267
|
+
};
|
|
268
|
+
for (const { name, value } of op.requestHeaders) {
|
|
269
|
+
headers[name] = value;
|
|
270
|
+
}
|
|
271
|
+
const response = await (0, node_fetch_1.default)(op.url, {
|
|
272
|
+
method: op.method,
|
|
273
|
+
headers,
|
|
274
|
+
body: buffer,
|
|
275
|
+
});
|
|
276
|
+
if (!response.ok) {
|
|
277
|
+
const text = await response.text();
|
|
278
|
+
throw new Error(`Failed to upload chunk ${index + 1}: ${response.status} ${response.statusText}\n${text}`);
|
|
279
|
+
}
|
|
280
|
+
logger.info(` Chunk ${index + 1}/${uploadOperations.length} uploaded.`);
|
|
281
|
+
});
|
|
282
|
+
await Promise.all(promises);
|
|
283
|
+
}
|
|
284
|
+
finally {
|
|
285
|
+
await fs_extra_1.default.close(fd);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
@@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createSetUpNpmrcBuildFunction = createSetUpNpmrcBuildFunction;
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
7
|
const steps_1 = require("@expo/steps");
|
|
10
|
-
const
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
11
10
|
const npmrc_1 = require("../../templates/npmrc");
|
|
11
|
+
const packageManager_1 = require("../../utils/packageManager");
|
|
12
12
|
function createSetUpNpmrcBuildFunction() {
|
|
13
13
|
return new steps_1.BuildFunction({
|
|
14
14
|
namespace: 'eas',
|
|
@@ -38,4 +38,3 @@ function createSetUpNpmrcBuildFunction() {
|
|
|
38
38
|
},
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
|
-
//# sourceMappingURL=useNpmToken.js.map
|
|
@@ -24,7 +24,7 @@ async function androidSetChannelNativelyAsync(channel, workingDirectory) {
|
|
|
24
24
|
const mainApp = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(androidManifest);
|
|
25
25
|
const stringifiedUpdatesRequestHeaders = config_plugins_1.AndroidConfig.Manifest.getMainApplicationMetaDataValue(androidManifest, AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY);
|
|
26
26
|
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApp, AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY, JSON.stringify({
|
|
27
|
-
...JSON.parse(stringifiedUpdatesRequestHeaders
|
|
27
|
+
...JSON.parse(stringifiedUpdatesRequestHeaders ?? '{}'),
|
|
28
28
|
'expo-channel-name': channel,
|
|
29
29
|
}), 'value');
|
|
30
30
|
await config_plugins_1.AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);
|
|
@@ -40,7 +40,6 @@ async function androidSetRuntimeVersionNativelyAsync(runtimeVersion, workingDire
|
|
|
40
40
|
await config_plugins_1.AndroidConfig.Manifest.writeAndroidManifestAsync(manifestPath, androidManifest);
|
|
41
41
|
}
|
|
42
42
|
async function androidGetNativelyDefinedChannelAsync(workingDirectory) {
|
|
43
|
-
var _a;
|
|
44
43
|
const manifestPath = await config_plugins_1.AndroidConfig.Paths.getAndroidManifestAsync(workingDirectory);
|
|
45
44
|
if (!(await fs_extra_1.default.pathExists(manifestPath))) {
|
|
46
45
|
return null;
|
|
@@ -48,11 +47,10 @@ async function androidGetNativelyDefinedChannelAsync(workingDirectory) {
|
|
|
48
47
|
const androidManifest = await config_plugins_1.AndroidConfig.Manifest.readAndroidManifestAsync(manifestPath);
|
|
49
48
|
const stringifiedUpdatesRequestHeaders = config_plugins_1.AndroidConfig.Manifest.getMainApplicationMetaDataValue(androidManifest, AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY);
|
|
50
49
|
try {
|
|
51
|
-
const updatesRequestHeaders = JSON.parse(stringifiedUpdatesRequestHeaders
|
|
52
|
-
return
|
|
50
|
+
const updatesRequestHeaders = JSON.parse(stringifiedUpdatesRequestHeaders ?? '{}');
|
|
51
|
+
return updatesRequestHeaders['expo-channel-name'] ?? null;
|
|
53
52
|
}
|
|
54
53
|
catch (err) {
|
|
55
54
|
throw new Error(`Failed to parse ${AndroidMetadataName.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY} from AndroidManifest.xml: ${err.message}`);
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
//# sourceMappingURL=expoUpdates.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { Android } from '@expo/eas-build-job';
|
|
1
2
|
import { bunyan } from '@expo/logger';
|
|
2
3
|
import { BuildStepEnv } from '@expo/steps';
|
|
3
|
-
import { Android } from '@expo/eas-build-job';
|
|
4
4
|
export declare function runGradleCommand({ logger, gradleCommand, androidDir, env, extraEnv, }: {
|
|
5
5
|
logger: bunyan;
|
|
6
6
|
gradleCommand: string;
|
|
@@ -5,11 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.runGradleCommand = runGradleCommand;
|
|
7
7
|
exports.resolveGradleCommand = resolveGradleCommand;
|
|
8
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
|
+
const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
|
|
8
10
|
const assert_1 = __importDefault(require("assert"));
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
11
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
-
const
|
|
12
|
-
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
13
|
async function runGradleCommand({ logger, gradleCommand, androidDir, env, extraEnv, }) {
|
|
14
14
|
const verboseFlag = env['EAS_VERBOSE'] === '1' ? '--info' : '';
|
|
15
15
|
logger.info(`Running 'gradlew ${gradleCommand} ${verboseFlag}' in ${androidDir}`);
|
|
@@ -53,7 +53,7 @@ function adjustOOMScore(spawnPromise, logger) {
|
|
|
53
53
|
}));
|
|
54
54
|
}
|
|
55
55
|
catch (err) {
|
|
56
|
-
logger.debug({ err, stderr: err
|
|
56
|
+
logger.debug({ err, stderr: err?.stderr }, 'Failed to override oom_score_adj');
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
// Wait 20 seconds to make sure all child processes are started
|
|
@@ -67,8 +67,8 @@ async function getChildrenPidsAsync(parentPids) {
|
|
|
67
67
|
return result.stdout
|
|
68
68
|
.toString()
|
|
69
69
|
.split('\n')
|
|
70
|
-
.map(
|
|
71
|
-
.filter(
|
|
70
|
+
.map(i => Number(i.trim()))
|
|
71
|
+
.filter(i => i);
|
|
72
72
|
}
|
|
73
73
|
catch {
|
|
74
74
|
return [];
|
|
@@ -109,4 +109,3 @@ function resolveGradleCommand(job, command) {
|
|
|
109
109
|
return ':app:bundleRelease';
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
//# sourceMappingURL=gradle.js.map
|
|
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.injectCredentialsGradleConfig = injectCredentialsGradleConfig;
|
|
7
7
|
exports.injectConfigureVersionGradleConfig = injectConfigureVersionGradleConfig;
|
|
8
|
-
const path_1 = __importDefault(require("path"));
|
|
9
8
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
10
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
9
|
const template_file_1 = require("@expo/template-file");
|
|
12
|
-
const
|
|
10
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
+
const path_1 = __importDefault(require("path"));
|
|
13
12
|
const EasBuildConfigureVersionGradle_1 = require("../../../templates/EasBuildConfigureVersionGradle");
|
|
13
|
+
const EasBuildInjectAndroidCredentialsGradle_1 = require("../../../templates/EasBuildInjectAndroidCredentialsGradle");
|
|
14
14
|
const APPLY_EAS_BUILD_INJECT_CREDENTIALS_GRADLE_LINE = 'apply from: "./eas-build-inject-android-credentials.gradle"';
|
|
15
15
|
const APPLY_EAS_BUILD_CONFIGURE_VERSION_GRADLE_LINE = 'apply from: "./eas-build-configure-version.gradle"';
|
|
16
16
|
async function injectCredentialsGradleConfig(logger, workingDir) {
|
|
@@ -84,6 +84,5 @@ function hasLine(haystack, needle) {
|
|
|
84
84
|
.replace(/\r\n/g, '\n')
|
|
85
85
|
.split('\n')
|
|
86
86
|
// Check for both single and double quotes
|
|
87
|
-
.some(
|
|
87
|
+
.some(line => line === needle || line === needle.replace(/"/g, "'")));
|
|
88
88
|
}
|
|
89
|
-
//# sourceMappingURL=gradleConfig.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config';
|
|
1
2
|
import { BuildJob, Metadata } from '@expo/eas-build-job';
|
|
2
3
|
import { bunyan } from '@expo/logger';
|
|
3
|
-
import { ExpoConfig } from '@expo/config';
|
|
4
4
|
export declare function configureEASUpdateAsync({ job, workingDirectory, logger, inputs, appConfig, metadata, }: {
|
|
5
5
|
job: BuildJob;
|
|
6
6
|
workingDirectory: string;
|
|
@@ -3,23 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.configureEASUpdateAsync = configureEASUpdateAsync;
|
|
4
4
|
exports.isEASUpdateConfigured = isEASUpdateConfigured;
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
-
const expoUpdates_1 = require("./
|
|
7
|
-
const expoUpdates_2 = require("./
|
|
6
|
+
const expoUpdates_1 = require("./android/expoUpdates");
|
|
7
|
+
const expoUpdates_2 = require("./ios/expoUpdates");
|
|
8
8
|
async function configureEASUpdateAsync({ job, workingDirectory, logger, inputs, appConfig, metadata, }) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if ((metadata === null || metadata === void 0 ? void 0 : metadata.runtimeVersion) && metadata.runtimeVersion !== runtimeVersion) {
|
|
9
|
+
const runtimeVersion = inputs.runtimeVersion ?? job.version?.runtimeVersion ?? inputs.resolvedRuntimeVersion;
|
|
10
|
+
if (metadata?.runtimeVersion && metadata.runtimeVersion !== runtimeVersion) {
|
|
12
11
|
logger.warn(`Runtime version from the app config evaluated on your local machine (${metadata.runtimeVersion}) does not match the one resolved here (${runtimeVersion}).`);
|
|
13
12
|
logger.warn("If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS environment variables.");
|
|
14
13
|
}
|
|
15
|
-
const jobOrInputChannel =
|
|
14
|
+
const jobOrInputChannel = inputs.channel ?? job.updates?.channel;
|
|
16
15
|
if (isEASUpdateConfigured(appConfig, logger)) {
|
|
17
16
|
if (jobOrInputChannel) {
|
|
18
17
|
await configureEASUpdate(job, logger, jobOrInputChannel, workingDirectory);
|
|
19
18
|
}
|
|
20
19
|
else {
|
|
21
20
|
const channel = await getChannelAsync(job, workingDirectory);
|
|
22
|
-
const isDevelopmentClient =
|
|
21
|
+
const isDevelopmentClient = job.developmentClient ?? false;
|
|
23
22
|
if (channel) {
|
|
24
23
|
const configFile = job.platform === eas_build_job_1.Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';
|
|
25
24
|
logger.info(`The channel name for EAS Update in ${configFile} is set to "${channel}"`);
|
|
@@ -28,8 +27,8 @@ async function configureEASUpdateAsync({ job, workingDirectory, logger, inputs,
|
|
|
28
27
|
// NO-OP: Development clients don't need to have a channel set
|
|
29
28
|
}
|
|
30
29
|
else {
|
|
31
|
-
const easUpdateUrl =
|
|
32
|
-
const jobProfile =
|
|
30
|
+
const easUpdateUrl = appConfig.updates?.url ?? null;
|
|
31
|
+
const jobProfile = job.buildProfile ?? null;
|
|
33
32
|
logger.warn(`This build has an invalid EAS Update configuration: update.url is set to "${easUpdateUrl}" in app config, but a channel is not specified${jobProfile ? '' : ` for the current build profile "${jobProfile}" in eas.json`}.`);
|
|
34
33
|
logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);
|
|
35
34
|
logger.warn(`- Run \`eas update:configure\` to set your channel in eas.json. For more details, see https://docs.expo.dev/eas-update/getting-started/#configure-your-project`);
|
|
@@ -45,8 +44,7 @@ async function configureEASUpdateAsync({ job, workingDirectory, logger, inputs,
|
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
function isEASUpdateConfigured(appConfig, logger) {
|
|
48
|
-
|
|
49
|
-
const rawUrl = (_a = appConfig.updates) === null || _a === void 0 ? void 0 : _a.url;
|
|
47
|
+
const rawUrl = appConfig.updates?.url;
|
|
50
48
|
if (!rawUrl) {
|
|
51
49
|
return false;
|
|
52
50
|
}
|
|
@@ -68,11 +66,11 @@ async function configureEASUpdate(job, logger, channel, workingDirectory) {
|
|
|
68
66
|
logger.info(`Setting the update request headers in '${configFile}' to '${JSON.stringify(newUpdateRequestHeaders)}'`);
|
|
69
67
|
switch (job.platform) {
|
|
70
68
|
case eas_build_job_1.Platform.ANDROID: {
|
|
71
|
-
await (0,
|
|
69
|
+
await (0, expoUpdates_1.androidSetChannelNativelyAsync)(channel, workingDirectory);
|
|
72
70
|
return;
|
|
73
71
|
}
|
|
74
72
|
case eas_build_job_1.Platform.IOS: {
|
|
75
|
-
await (0,
|
|
73
|
+
await (0, expoUpdates_2.iosSetChannelNativelyAsync)(channel, workingDirectory);
|
|
76
74
|
return;
|
|
77
75
|
}
|
|
78
76
|
default:
|
|
@@ -82,10 +80,10 @@ async function configureEASUpdate(job, logger, channel, workingDirectory) {
|
|
|
82
80
|
async function getChannelAsync(job, workingDirectory) {
|
|
83
81
|
switch (job.platform) {
|
|
84
82
|
case eas_build_job_1.Platform.ANDROID: {
|
|
85
|
-
return await (0,
|
|
83
|
+
return await (0, expoUpdates_1.androidGetNativelyDefinedChannelAsync)(workingDirectory);
|
|
86
84
|
}
|
|
87
85
|
case eas_build_job_1.Platform.IOS: {
|
|
88
|
-
return await (0,
|
|
86
|
+
return await (0, expoUpdates_2.iosGetNativelyDefinedChannelAsync)(workingDirectory);
|
|
89
87
|
}
|
|
90
88
|
default:
|
|
91
89
|
throw new Error(`Platform is not supported.`);
|
|
@@ -94,15 +92,14 @@ async function getChannelAsync(job, workingDirectory) {
|
|
|
94
92
|
async function setRuntimeVersionNativelyAsync(job, runtimeVersion, workingDirectory) {
|
|
95
93
|
switch (job.platform) {
|
|
96
94
|
case eas_build_job_1.Platform.ANDROID: {
|
|
97
|
-
await (0,
|
|
95
|
+
await (0, expoUpdates_1.androidSetRuntimeVersionNativelyAsync)(runtimeVersion, workingDirectory);
|
|
98
96
|
return;
|
|
99
97
|
}
|
|
100
98
|
case eas_build_job_1.Platform.IOS: {
|
|
101
|
-
await (0,
|
|
99
|
+
await (0, expoUpdates_2.iosSetRuntimeVersionNativelyAsync)(runtimeVersion, workingDirectory);
|
|
102
100
|
return;
|
|
103
101
|
}
|
|
104
102
|
default:
|
|
105
103
|
throw new Error(`Platform is not supported.`);
|
|
106
104
|
}
|
|
107
105
|
}
|
|
108
|
-
//# sourceMappingURL=expoUpdates.js.map
|