@expo/build-tools 1.0.21 → 1.0.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/android/gradle.d.ts +1 -1
- package/dist/android/gradle.js +6 -2
- package/dist/android/gradle.js.map +1 -1
- package/dist/builders/android.js +5 -3
- package/dist/builders/android.js.map +1 -1
- package/dist/builders/common.js +1 -12
- package/dist/builders/common.js.map +1 -1
- package/dist/builders/ios.js +5 -3
- package/dist/builders/ios.js.map +1 -1
- package/dist/common/prebuild.js +1 -1
- package/dist/common/prebuild.js.map +1 -1
- package/dist/steps/easFunctions.js +9 -7
- package/dist/steps/easFunctions.js.map +1 -1
- package/dist/steps/functions/{buildReactNativeApp.d.ts → eas/buildReactNativeApp.d.ts} +1 -1
- package/dist/steps/functions/{buildReactNativeApp.js → eas/buildReactNativeApp.js} +1 -1
- package/dist/steps/functions/eas/buildReactNativeApp.js.map +1 -0
- package/dist/steps/functions/eas/checkout.js.map +1 -0
- package/dist/steps/functions/eas/findAndUploadBuildArtifacts.d.ts +4 -0
- package/dist/steps/functions/eas/findAndUploadBuildArtifacts.js +28 -0
- package/dist/steps/functions/eas/findAndUploadBuildArtifacts.js.map +1 -0
- package/dist/steps/functions/{installNodeModules.d.ts → eas/installNodeModules.d.ts} +1 -1
- package/dist/steps/functions/{installNodeModules.js → eas/installNodeModules.js} +1 -1
- package/dist/steps/functions/eas/installNodeModules.js.map +1 -0
- package/dist/steps/functions/{prebuild.d.ts → eas/prebuild.d.ts} +1 -1
- package/dist/steps/functions/{prebuild.js → eas/prebuild.js} +3 -1
- package/dist/steps/functions/eas/prebuild.js.map +1 -0
- package/dist/steps/functions/{setUpNpmrc.d.ts → eas/setUpNpmrc.d.ts} +1 -1
- package/dist/steps/functions/{setUpNpmrc.js → eas/setUpNpmrc.js} +1 -1
- package/dist/steps/functions/eas/setUpNpmrc.js.map +1 -0
- package/dist/steps/functions/{runGradle.d.ts → utils/runGradle.d.ts} +1 -1
- package/dist/steps/functions/{runGradle.js → utils/runGradle.js} +1 -5
- package/dist/steps/functions/utils/runGradle.js.map +1 -0
- package/dist/steps/functions/{uploadArtifact.d.ts → utils/uploadArtifact.d.ts} +1 -1
- package/dist/steps/functions/{uploadArtifact.js → utils/uploadArtifact.js} +2 -2
- package/dist/steps/functions/utils/uploadArtifact.js.map +1 -0
- package/dist/utils/artifacts.d.ts +8 -0
- package/dist/utils/artifacts.js +22 -1
- package/dist/utils/artifacts.js.map +1 -1
- package/package.json +3 -3
- package/dist/steps/functions/buildReactNativeApp.js.map +0 -1
- package/dist/steps/functions/checkout.js.map +0 -1
- package/dist/steps/functions/installNodeModules.js.map +0 -1
- package/dist/steps/functions/prebuild.js.map +0 -1
- package/dist/steps/functions/runGradle.js.map +0 -1
- package/dist/steps/functions/setUpNpmrc.js.map +0 -1
- package/dist/steps/functions/uploadArtifact.js.map +0 -1
- /package/dist/steps/functions/{checkout.d.ts → eas/checkout.d.ts} +0 -0
- /package/dist/steps/functions/{checkout.js → eas/checkout.js} +0 -0
package/dist/android/gradle.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Android, Job } from '@expo/eas-build-job';
|
|
|
3
3
|
import { bunyan } from '@expo/logger';
|
|
4
4
|
import { BuildContext } from '../context';
|
|
5
5
|
export declare function ensureLFLineEndingsInGradlewScript<TJob extends Job>(ctx: BuildContext<TJob>): Promise<void>;
|
|
6
|
-
export declare function runGradleCommand(ctx: BuildContext<
|
|
6
|
+
export declare function runGradleCommand(ctx: BuildContext<Job>, { logger, gradleCommand, androidDir, }: {
|
|
7
7
|
logger: bunyan;
|
|
8
8
|
gradleCommand: string;
|
|
9
9
|
androidDir: string;
|
package/dist/android/gradle.js
CHANGED
|
@@ -72,10 +72,14 @@ function adjustOOMScore(spawnPromise, logger) {
|
|
|
72
72
|
function resolveVersionOverridesEnvs(ctx) {
|
|
73
73
|
var _a, _b;
|
|
74
74
|
const extraEnvs = {};
|
|
75
|
-
if (
|
|
75
|
+
if (ctx.job.platform === eas_build_job_1.Platform.ANDROID &&
|
|
76
|
+
((_a = ctx.job.version) === null || _a === void 0 ? void 0 : _a.versionCode) &&
|
|
77
|
+
!ctx.env.EAS_BUILD_ANDROID_VERSION_CODE) {
|
|
76
78
|
extraEnvs.EAS_BUILD_ANDROID_VERSION_CODE = ctx.job.version.versionCode;
|
|
77
79
|
}
|
|
78
|
-
if (
|
|
80
|
+
if (ctx.job.platform === eas_build_job_1.Platform.ANDROID &&
|
|
81
|
+
((_b = ctx.job.version) === null || _b === void 0 ? void 0 : _b.versionName) &&
|
|
82
|
+
!ctx.env.EAS_BUILD_ANDROID_VERSION_NAME) {
|
|
79
83
|
extraEnvs.EAS_BUILD_ANDROID_VERSION_NAME = ctx.job.version.versionName;
|
|
80
84
|
}
|
|
81
85
|
return extraEnvs;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gradle.js","sourceRoot":"","sources":["../../src/android/gradle.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAA4B;AAE5B,sEAAsE;AACtE,
|
|
1
|
+
{"version":3,"file":"gradle.js","sourceRoot":"","sources":["../../src/android/gradle.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,oDAA4B;AAE5B,sEAAsE;AACtE,uDAAkE;AAClE,wDAA0B;AAI1B,kDAA4E;AAErE,KAAK,UAAU,kCAAkC,CACtD,GAAuB;IAEvB,MAAM,WAAW,GAAG,cAAI,CAAC,IAAI,CAAC,GAAG,CAAC,8BAA8B,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;IAC1F,MAAM,cAAc,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;IAC9D,IAAI,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;QACjC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;QACzE,MAAM,kBAAE,CAAC,SAAS,CAA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ACrB,OAAO,GAAG,CAAC,aAAa,CAAC;KAC1B;SAAM,IAAI,GAAG,CAAC,iBAAiB,EAAE;QAChC,OAAO,oBAAoB,CAAC;KAC7B;SAAM,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE;QACzB,OAAO,oBAAoB,CAAC;KAC7B;SAAM,IAAI,GAAG,CAAC,SAAS,KAAK,uBAAO,CAAC,SAAS,CAAC,GAAG,EAAE;QAClD,OAAO,sBAAsB,CAAC;KAC/B;SAAM;QACL,OAAO,oBAAoB,CAAC;KAC7B;AACH,CAAC;AAZD,oDAYC","sourcesContent":["import path from 'path';\nimport assert from 'assert';\n\nimport spawn, { SpawnPromise, SpawnResult } from '@expo/turtle-spawn';\nimport { Android, Env, Job, Platform } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport { bunyan } from '@expo/logger';\n\nimport { BuildContext } from '../context';\nimport { getParentAndDescendantProcessPidsAsync } from '../utils/processes';\n\nexport async function ensureLFLineEndingsInGradlewScript<TJob extends Job>(\n ctx: BuildContext<TJob>\n): Promise<void> {\n const gradlewPath = path.join(ctx.getReactNativeProjectDirectory(), 'android', 'gradlew');\n const gradlewContent = await fs.readFile(gradlewPath, 'utf8');\n if (gradlewContent.includes('\\r')) {\n ctx.logger.info('Replacing CRLF line endings with LF in gradlew script');\n await fs.writeFile(gradlewPath, gradlewContent.replace(/\\r\\n/g, '\\n'), 'utf8');\n }\n}\n\nexport async function runGradleCommand(\n ctx: BuildContext<Job>,\n {\n logger,\n gradleCommand,\n androidDir,\n }: { logger: bunyan; gradleCommand: string; androidDir: string }\n): Promise<void> {\n logger.info(`Running 'gradlew ${gradleCommand}' in ${androidDir}`);\n const spawnPromise = spawn('bash', ['-c', `sh gradlew ${gradleCommand}`], {\n cwd: androidDir,\n logger,\n lineTransformer: (line?: string) => {\n if (!line || /^\\.+$/.exec(line)) {\n return null;\n } else {\n return line;\n }\n },\n env: { ...ctx.env, ...resolveVersionOverridesEnvs(ctx) },\n });\n if (ctx.env.EAS_BUILD_RUNNER === 'eas-build' && process.platform === 'linux') {\n adjustOOMScore(spawnPromise, logger);\n }\n\n await spawnPromise;\n}\n\n/**\n * OOM Killer sometimes kills worker server while build is exceeding memory limits.\n * `oom_score_adj` is a value between -1000 and 1000 and it defaults to 0.\n * It defines which process is more likely to get killed (higher value more likely).\n *\n * This function sets oom_score_adj for Gradle process and all its child processes.\n */\nfunction adjustOOMScore(spawnPromise: SpawnPromise<SpawnResult>, logger: bunyan): void {\n setTimeout(\n async () => {\n try {\n assert(spawnPromise.child.pid);\n const pids = await getParentAndDescendantProcessPidsAsync(spawnPromise.child.pid);\n await Promise.all(\n pids.map(async (pid: number) => {\n // Value 800 is just a guess here. It's probably higher than most other\n // process. I didn't want to set it any higher, because I'm not sure if OOM Killer\n // can start killing processes when there is still enough memory left.\n const oomScoreOverride = 800;\n await fs.writeFile(`/proc/${pid}/oom_score_adj`, `${oomScoreOverride}\\n`);\n })\n );\n } catch (err: any) {\n logger.debug({ err, stderr: err?.stderr }, 'Failed to override oom_score_adj');\n }\n },\n // Wait 20 seconds to make sure all child processes are started\n 20000\n );\n}\n\n// Version envs should be set at the beginning of the build, but when building\n// from github those values are resolved latter.\nfunction resolveVersionOverridesEnvs(ctx: BuildContext<Job>): Env {\n const extraEnvs: Env = {};\n if (\n ctx.job.platform === Platform.ANDROID &&\n ctx.job.version?.versionCode &&\n !ctx.env.EAS_BUILD_ANDROID_VERSION_CODE\n ) {\n extraEnvs.EAS_BUILD_ANDROID_VERSION_CODE = ctx.job.version.versionCode;\n }\n if (\n ctx.job.platform === Platform.ANDROID &&\n ctx.job.version?.versionName &&\n !ctx.env.EAS_BUILD_ANDROID_VERSION_NAME\n ) {\n extraEnvs.EAS_BUILD_ANDROID_VERSION_NAME = ctx.job.version.versionName;\n }\n return extraEnvs;\n}\n\nexport function resolveGradleCommand(job: Android.Job): string {\n if (job.gradleCommand) {\n return job.gradleCommand;\n } else if (job.developmentClient) {\n return ':app:assembleDebug';\n } else if (!job.buildType) {\n return ':app:bundleRelease';\n } else if (job.buildType === Android.BuildType.APK) {\n return ':app:assembleRelease';\n } else {\n return ':app:bundleRelease';\n }\n}\n"]}
|
package/dist/builders/android.js
CHANGED
|
@@ -87,9 +87,11 @@ async function buildAsync(ctx) {
|
|
|
87
87
|
});
|
|
88
88
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {
|
|
89
89
|
var _a;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
await (0, artifacts_1.uploadApplicationArchive)(ctx, {
|
|
91
|
+
patternOrPath: (_a = ctx.job.applicationArchivePath) !== null && _a !== void 0 ? _a : 'android/app/build/outputs/**/*.{apk,aab}',
|
|
92
|
+
rootDir: ctx.getReactNativeProjectDirectory(),
|
|
93
|
+
logger: ctx.logger,
|
|
94
|
+
});
|
|
93
95
|
});
|
|
94
96
|
}
|
|
95
97
|
//# sourceMappingURL=android.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,uDAA+E;AAC/E,4DAAoC;AAEpC,
|
|
1
|
+
{"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/builders/android.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AAExB,uDAA+E;AAC/E,4DAAoC;AAEpC,wCAA2E;AAC3E,sDAA4E;AAC5E,8CAI2B;AAC3B,kDAA8D;AAC9D,0CAAwD;AACxD,wDAA4D;AAC5D,0DAA+D;AAC/D,2CAA6C;AAC7C,iDAAmD;AAEnD,qCAAoD;AACpD,qCAA+C;AAEhC,KAAK,UAAU,cAAc,CAAC,GAA8B;IACzE,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,KAAK,EAAE;QACpC,OAAO,MAAM,IAAA,iCAAwB,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;KACx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yB,EAAE,KAAK,IAAI,EAAE;QACvE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,oBAAoB,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;;QACxD,MAAM,CAAA,MAAA,GAAG,CAAC,YAAY,0CAAE,SAAS,CAAC,GAAG,CAAC,CAAA,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;;QACxE,MAAM,IAAA,oCAAwB,EAAC,GAAG,EAAE;YAClC,aAAa,EAAE,MAAA,GAAG,CAAC,GAAG,CAAC,sBAAsB,mCAAI,0CAA0C;YAC3F,OAAO,EAAE,GAAG,CAAC,8BAA8B,EAAE;YAC7C,MAAM,EAAE,GAAG,CAAC,MAAM;SACnB,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import path from 'path';\n\nimport { Android, BuildMode, BuildPhase, Workflow } from '@expo/eas-build-job';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, BuildContext, SkipNativeBuildError } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport {\n runGradleCommand,\n ensureLFLineEndingsInGradlewScript,\n resolveGradleCommand,\n} from '../android/gradle';\nimport { uploadApplicationArchive } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { restoreCredentials } from '../android/credentials';\nimport { configureBuildGradle } from '../android/gradleConfig';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function androidBuilder(ctx: BuildContext<Android.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n throw new Error('Not implemented');\n } else if (ctx.job.mode === BuildMode.CUSTOM) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n if (hasNativeCode) {\n await ctx.runBuildPhase(BuildPhase.FIX_GRADLEW, async () => {\n await ensureLFLineEndingsInGradlewScript(ctx);\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"android\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/android-builds/'\n );\n return;\n }\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n if (\n nullthrows(ctx.job.secrets, 'Secrets must be defined for non-custom builds').buildCredentials\n ) {\n await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n await restoreCredentials(ctx);\n await configureBuildGradle(ctx);\n });\n }\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n if (ctx.skipNativeBuild) {\n throw new SkipNativeBuildError('Skipping Gradle build');\n }\n await ctx.runBuildPhase(BuildPhase.RUN_GRADLEW, async () => {\n const gradleCommand = resolveGradleCommand(ctx.job);\n await runGradleCommand(ctx, {\n logger: ctx.logger,\n gradleCommand,\n androidDir: path.join(ctx.getReactNativeProjectDirectory(), 'android'),\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n await uploadApplicationArchive(ctx, {\n patternOrPath: ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}',\n rootDir: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n });\n });\n}\n"]}
|
package/dist/builders/common.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.runBuilderWithHooksAsync = void 0;
|
|
4
4
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
-
const context_1 = require("../context");
|
|
6
5
|
const xcodeBuildLogs_1 = require("../ios/xcodeBuildLogs");
|
|
7
6
|
const artifacts_1 = require("../utils/artifacts");
|
|
8
7
|
const hooks_1 = require("../utils/hooks");
|
|
@@ -34,17 +33,7 @@ async function runBuilderWithHooksAsync(ctx, builderAsync) {
|
|
|
34
33
|
await (0, xcodeBuildLogs_1.findAndUploadXcodeBuildLogsAsync)(ctx);
|
|
35
34
|
}
|
|
36
35
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {
|
|
37
|
-
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
try {
|
|
41
|
-
const buildArtifacts = (await Promise.all(ctx.job.buildArtifactPaths.map((path) => (0, artifacts_1.findArtifacts)(ctx.getReactNativeProjectDirectory(), path, ctx.logger)))).flat();
|
|
42
|
-
ctx.logger.info(`Uploading build artifacts: ${buildArtifacts.join(', ')}`);
|
|
43
|
-
await ctx.uploadArtifacts(context_1.ArtifactType.BUILD_ARTIFACTS, buildArtifacts, ctx.logger);
|
|
44
|
-
}
|
|
45
|
-
catch (err) {
|
|
46
|
-
ctx.logger.error({ err }, 'Failed to upload build artifacts');
|
|
47
|
-
}
|
|
36
|
+
await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, ctx.logger);
|
|
48
37
|
});
|
|
49
38
|
}
|
|
50
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/builders/common.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/builders/common.ts"],"names":[],"mappings":";;;AAAA,uDAAqE;AAGrE,0DAAyE;AACzE,kDAAsE;AACtE,0CAAwD;AAEjD,KAAK,UAAU,wBAAwB,CAC5C,GAAoB,EACpB,YAAqD;IAErD,IAAI;QACF,IAAI,YAAY,GAAG,IAAI,CAAC;QACxB,IAAI;YACF,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;YACxB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;gBACnE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,gBAAgB,CAAC,CAAC;YACrD,CAAC,CAAC,CAAC;SACJ;QAAC,OAAO,GAAQ,EAAE;YACjB,YAAY,GAAG,KAAK,CAAC;YACrB,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;gBACjE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,cAAc,CAAC,CAAC;YACnD,CAAC,CAAC,CAAC;YACH,MAAM,GAAG,CAAC;SACX;gBAAS;YACR,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;gBACpE,MAAM,IAAA,wBAAgB,EAAC,GAAG,EAAE,YAAI,CAAC,iBAAiB,EAAE;oBAClD,SAAS,EAAE;wBACT,gBAAgB,EAAE,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS;qBACxD;iBACF,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE;gBACrC,MAAM,IAAA,iDAAgC,EAAC,GAA4B,CAAC,CAAC;aACtE;YAED,MAAM,GAAG,CAAC,aAAa,CAAC,0BAAU,CAAC,sBAAsB,EAAE,KAAK,IAAI,EAAE;gBACpE,MAAM,IAAA,4CAAgC,EAAC,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;YAC1D,CAAC,CAAC,CAAC;SACJ;KACF;IAAC,OAAO,GAAQ,EAAE;QACjB,GAAG,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC9B,MAAM,GAAG,CAAC;KACX;IAED,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IAED,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC;AA5CD,4DA4CC","sourcesContent":["import { BuildPhase, Ios, Job, Platform } from '@expo/eas-build-job';\n\nimport { Artifacts, BuildContext } from '../context';\nimport { findAndUploadXcodeBuildLogsAsync } from '../ios/xcodeBuildLogs';\nimport { maybeFindAndUploadBuildArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\n\nexport async function runBuilderWithHooksAsync<T extends Job>(\n ctx: BuildContext<T>,\n builderAsync: (ctx: BuildContext<T>) => Promise<void>\n): Promise<Artifacts> {\n try {\n let buildSuccess = true;\n try {\n await builderAsync(ctx);\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_SUCCESS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_SUCCESS);\n });\n } catch (err: any) {\n buildSuccess = false;\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_ERROR_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_ERROR);\n });\n throw err;\n } finally {\n await ctx.runBuildPhase(BuildPhase.ON_BUILD_COMPLETE_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.ON_BUILD_COMPLETE, {\n extraEnvs: {\n EAS_BUILD_STATUS: buildSuccess ? 'finished' : 'errored',\n },\n });\n });\n\n if (ctx.job.platform === Platform.IOS) {\n await findAndUploadXcodeBuildLogsAsync(ctx as BuildContext<Ios.Job>);\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_BUILD_ARTIFACTS, async () => {\n await maybeFindAndUploadBuildArtifacts(ctx, ctx.logger);\n });\n }\n } catch (err: any) {\n err.artifacts = ctx.artifacts;\n throw err;\n }\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n\n return ctx.artifacts;\n}\n"]}
|
package/dist/builders/ios.js
CHANGED
|
@@ -103,9 +103,11 @@ async function buildAsync(ctx) {
|
|
|
103
103
|
await ((_a = ctx.cacheManager) === null || _a === void 0 ? void 0 : _a.saveCache(ctx));
|
|
104
104
|
});
|
|
105
105
|
await ctx.runBuildPhase(eas_build_job_1.BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
await (0, artifacts_1.uploadApplicationArchive)(ctx, {
|
|
107
|
+
patternOrPath: (0, resolve_1.resolveArtifactPath)(ctx),
|
|
108
|
+
rootDir: ctx.getReactNativeProjectDirectory(),
|
|
109
|
+
logger: ctx.logger,
|
|
110
|
+
});
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
113
|
async function readEntitlementsAsync(ctx, { scheme, buildConfiguration }) {
|
package/dist/builders/ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.js","sourceRoot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AG,CAAC,MAAM,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IACD,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { findArtifacts } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n return await resignAsync(ctx);\n } else if (ctx.job.mode === BuildMode.CUSTOM) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n options: { extraEnvs },\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await installPods(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n const applicationArchives = await findArtifacts(\n ctx.getReactNativeProjectDirectory(),\n resolveArtifactPath(ctx),\n ctx.logger\n );\n ctx.logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, ctx.logger);\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName =\n await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.getReactNativeProjectDirectory(),\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.getReactNativeProjectDirectory(),\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n [applicationArchivePath],\n ctx.logger\n );\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/builders/ios.ts"],"names":[],"mappings":";;;;;AAAA,wDAAgC;AAChC,yDAAiD;AACjD,uDAA2E;AAC3E,wDAA0B;AAC1B,4DAAoC;AAEpC,wCAAmE;AACnE,sDAA4E;AAC5E,kDAA8D;AAC9D,0CAAwD;AACxD,gDAAyD;AACzD,yEAA4D;AAC5D,8CAAoE;AACpE,oCAAyC;AACzC,0CAAgE;AAChE,4CAA+F;AAC/F,2CAA6C;AAC7C,iDAAmD;AAEnD,qCAAoD;AACpD,qCAA+C;AAEhC,KAAK,UAAU,UAAU,CAAC,GAA0B;IACjE,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,KAAK,EAAE;QACpC,OAAO,MAAM,IAAA,iCAAwB,EAAC,GAAG,EAAE,UAAU,CAAC,CAAC;KACxD;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,MAAM,EAAE;QAC5C,OAAO,MAAM,WAAW,CAAC,GAAG,CAAC,CAAC;KAC/B;SAAM,IAAI,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,yBAAS,CAAC,MAAM,EAAE;QAC5C,OAAO,MAAM,IAAA,4BAAmB,EAAC,GAAG,CAAC,CAAC;KACvC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;KACpC;AACH,CAAC;AAVD,6BAUC;AAED,KAAK,UAAU,UAAU,C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E,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,wBAAwB,sBAAsB,EAAE,CAAC,CAAC;QAClE,MAAM,GAAG,CAAC,eAAe,CACvB,sBAAY,CAAC,mBAAmB,EAChC,CAAC,sBAAsB,CAAC,EACxB,GAAG,CAAC,MAAM,CACX,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,mBAAmB,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;KAC5D;IACD,OAAO,GAAG,CAAC,SAAS,CAAC;AACvB,CAAC","sourcesContent":["import plist from '@expo/plist';\nimport { IOSConfig } from '@expo/config-plugins';\nimport { BuildMode, BuildPhase, Ios, Workflow } from '@expo/eas-build-job';\nimport fs from 'fs-extra';\nimport nullthrows from 'nullthrows';\n\nimport { Artifacts, ArtifactType, BuildContext } from '../context';\nimport { configureExpoUpdatesIfInstalledAsync } from '../utils/expoUpdates';\nimport { uploadApplicationArchive } from '../utils/artifacts';\nimport { Hook, runHookIfPresent } from '../utils/hooks';\nimport { configureXcodeProject } from '../ios/configure';\nimport CredentialsManager from '../ios/credentials/manager';\nimport { runFastlaneGym, runFastlaneResign } from '../ios/fastlane';\nimport { installPods } from '../ios/pod';\nimport { downloadApplicationArchiveAsync } from '../ios/resign';\nimport { resolveArtifactPath, resolveBuildConfiguration, resolveScheme } from '../ios/resolve';\nimport { setupAsync } from '../common/setup';\nimport { prebuildAsync } from '../common/prebuild';\n\nimport { runBuilderWithHooksAsync } from './common';\nimport { runCustomBuildAsync } from './custom';\n\nexport default async function iosBuilder(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n if (ctx.job.mode === BuildMode.BUILD) {\n return await runBuilderWithHooksAsync(ctx, buildAsync);\n } else if (ctx.job.mode === BuildMode.RESIGN) {\n return await resignAsync(ctx);\n } else if (ctx.job.mode === BuildMode.CUSTOM) {\n return await runCustomBuildAsync(ctx);\n } else {\n throw new Error('Not implemented');\n }\n}\n\nasync function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {\n await setupAsync(ctx);\n const hasNativeCode = ctx.job.type === Workflow.GENERIC;\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.PREBUILD, async () => {\n if (hasNativeCode) {\n ctx.markBuildPhaseSkipped();\n ctx.logger.info(\n 'Skipped running \"expo prebuild\" because the \"ios\" directory already exists. Learn more about the build process: https://docs.expo.dev/build-reference/ios-builds/'\n );\n return;\n }\n const extraEnvs: Record<string, string> = credentials?.teamId\n ? { APPLE_TEAM_ID: credentials.teamId }\n : {};\n await prebuildAsync(ctx, {\n logger: ctx.logger,\n workingDir: ctx.getReactNativeProjectDirectory(),\n options: { extraEnvs },\n });\n });\n\n await ctx.runBuildPhase(BuildPhase.RESTORE_CACHE, async () => {\n await ctx.cacheManager?.restoreCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.INSTALL_PODS, async () => {\n await installPods(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.POST_INSTALL_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.POST_INSTALL);\n });\n\n const buildConfiguration = resolveBuildConfiguration(ctx);\n if (credentials) {\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_XCODE_PROJECT, async () => {\n await configureXcodeProject(ctx, { credentials, buildConfiguration });\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.CONFIGURE_EXPO_UPDATES, async () => {\n await configureExpoUpdatesIfInstalledAsync(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n const scheme = resolveScheme(ctx);\n const entitlements = await readEntitlementsAsync(ctx, { scheme, buildConfiguration });\n await runFastlaneGym(ctx, {\n credentials,\n scheme,\n buildConfiguration,\n entitlements,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.PRE_UPLOAD_ARTIFACTS_HOOK, async () => {\n await runHookIfPresent(ctx, Hook.PRE_UPLOAD_ARTIFACTS);\n });\n\n await ctx.runBuildPhase(BuildPhase.SAVE_CACHE, async () => {\n await ctx.cacheManager?.saveCache(ctx);\n });\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n await uploadApplicationArchive(ctx, {\n patternOrPath: resolveArtifactPath(ctx),\n rootDir: ctx.getReactNativeProjectDirectory(),\n logger: ctx.logger,\n });\n });\n}\n\nasync function readEntitlementsAsync(\n ctx: BuildContext<Ios.Job>,\n { scheme, buildConfiguration }: { scheme: string; buildConfiguration: string }\n): Promise<object | null> {\n try {\n const applicationTargetName =\n await IOSConfig.BuildScheme.getApplicationTargetNameForSchemeAsync(\n ctx.getReactNativeProjectDirectory(),\n scheme\n );\n const entitlementsPath = IOSConfig.Entitlements.getEntitlementsPath(\n ctx.getReactNativeProjectDirectory(),\n {\n buildConfiguration,\n targetName: applicationTargetName,\n }\n );\n if (!entitlementsPath) {\n return null;\n }\n const entitlementsRaw = await fs.readFile(entitlementsPath, 'utf8');\n return plist.parse(entitlementsRaw);\n } catch (err) {\n ctx.logger.warn({ err }, 'Failed to read entitlements');\n ctx.markBuildPhaseHasWarnings();\n return null;\n }\n}\n\nasync function resignAsync(ctx: BuildContext<Ios.Job>): Promise<Artifacts> {\n const applicationArchivePath = await ctx.runBuildPhase(\n BuildPhase.DOWNLOAD_APPLICATION_ARCHIVE,\n async () => {\n return await downloadApplicationArchiveAsync(ctx);\n }\n );\n\n const credentialsManager = new CredentialsManager(ctx);\n try {\n const credentials = await ctx.runBuildPhase(BuildPhase.PREPARE_CREDENTIALS, async () => {\n return await credentialsManager.prepare();\n });\n\n await ctx.runBuildPhase(BuildPhase.RUN_FASTLANE, async () => {\n await runFastlaneResign(ctx, {\n credentials: nullthrows(credentials),\n ipaPath: applicationArchivePath,\n });\n });\n } finally {\n await ctx.runBuildPhase(BuildPhase.CLEAN_UP_CREDENTIALS, async () => {\n await credentialsManager.cleanUp();\n });\n }\n\n await ctx.runBuildPhase(BuildPhase.UPLOAD_APPLICATION_ARCHIVE, async () => {\n ctx.logger.info(`Application archive: ${applicationArchivePath}`);\n await ctx.uploadArtifacts(\n ArtifactType.APPLICATION_ARCHIVE,\n [applicationArchivePath],\n ctx.logger\n );\n });\n\n if (!ctx.artifacts.APPLICATION_ARCHIVE) {\n throw new Error('Builder must upload application archive');\n }\n return ctx.artifacts;\n}\n"]}
|
package/dist/common/prebuild.js
CHANGED
|
@@ -25,7 +25,7 @@ async function prebuildAsync(ctx, { logger, workingDir, options }) {
|
|
|
25
25
|
await (0, project_1.runExpoCliCommand)(ctx, prebuildCommandArgs, spawnOptions, {
|
|
26
26
|
npmVersionAtLeast7: await (0, packageManager_1.isAtLeastNpm7Async)(),
|
|
27
27
|
});
|
|
28
|
-
await (0, installDependencies_1.installDependenciesAsync)(ctx, { logger, workingDir });
|
|
28
|
+
await (0, installDependencies_1.installDependenciesAsync)(ctx, { logger, workingDir: (0, installDependencies_1.resolvePackagerDir)(ctx) });
|
|
29
29
|
}
|
|
30
30
|
exports.prebuildAsync = prebuildAsync;
|
|
31
31
|
function getPrebuildCommandArgs(ctx, { options }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../src/common/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAI5B,4DAA6D;AAC7D,8CAA6E;AAE7E,+
|
|
1
|
+
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../src/common/prebuild.ts"],"names":[],"mappings":";;;;;;AAEA,oDAA4B;AAI5B,4DAA6D;AAC7D,8CAA6E;AAE7E,+DAAqF;AAQ9E,KAAK,UAAU,aAAa,CACjC,GAAuB,EACvB,EAAE,MAAM,EAAE,UAAU,EAA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AP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,EAAE;QACjC,eAAe,GAAG,GAAG,eAAe,6BAA6B,OAAO,CAAC,oBAAoB,EAAE,CAAC;KACjG;IACD,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,EAAE;QAClB,eAAe,GAAG,GAAG,eAAe,UAAU,CAAC;KAChD;IACD,MAAM,gBAAgB,GAAG,MAAM,CAAC;IAChC,MAAM,iBAAiB,GAAG,OAAO,CAAC;IAClC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IACzC,IAAI,eAAe,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE;QAChD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KAC7E;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE;QACjD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KAC9E;IACD,IAAI,eAAe,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE;QACpD,eAAe,GAAG,eAAe,CAAC,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;KACjF;IACD,IAAI,CAAC,IAAA,gCAAsB,EAAC,GAAG,CAAC,EAAE;QAChC,eAAe,GAAG,eAAe,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;KACrE;IACD,OAAO,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACpC,CAAC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { SpawnOptions } from '@expo/turtle-spawn';\nimport semver from 'semver';\nimport { bunyan } from '@expo/logger';\n\nimport { BuildContext } from '../context';\nimport { isAtLeastNpm7Async } from '../utils/packageManager';\nimport { runExpoCliCommand, shouldUseGlobalExpoCli } from '../utils/project';\n\nimport { installDependenciesAsync, resolvePackagerDir } from './installDependencies';\n\nexport interface PrebuildOptions {\n extraEnvs?: Record<string, string>;\n clean?: boolean;\n skipDependencyUpdate?: string;\n}\n\nexport async function prebuildAsync<TJob extends Job>(\n ctx: BuildContext<TJob>,\n { logger, workingDir, options }: { logger: bunyan; workingDir: string; options?: PrebuildOptions }\n): Promise<void> {\n const customExpoCliVersion = ctx.job.builderEnvironment?.expoCli;\n const shouldDisableSharp =\n !customExpoCliVersion || semver.satisfies(customExpoCliVersion, '>=5.4.4');\n\n const spawnOptions: SpawnOptions = {\n cwd: workingDir,\n logger,\n env: {\n ...(shouldDisableSharp ? { EXPO_IMAGE_UTILS_NO_SHARP: '1' } : {}),\n ...options?.extraEnvs,\n ...ctx.env,\n },\n };\n\n const prebuildCommandArgs = getPrebuildCommandArgs(ctx, { options });\n await runExpoCliCommand(ctx, prebuildCommandArgs, spawnOptions, {\n npmVersionAtLeast7: await isAtLeastNpm7Async(),\n });\n await installDependenciesAsync(ctx, { logger, workingDir: resolvePackagerDir(ctx) });\n}\n\nfunction getPrebuildCommandArgs<TJob extends Job>(\n ctx: BuildContext<TJob>,\n { options }: { options?: PrebuildOptions }\n): string[] {\n let prebuildCommand =\n ctx.job.experimental?.prebuildCommand ??\n `prebuild --non-interactive --no-install --platform ${ctx.job.platform}`;\n if (!prebuildCommand.match(/(?:--platform| -p)/)) {\n prebuildCommand = `${prebuildCommand} --platform ${ctx.job.platform}`;\n }\n if (options?.skipDependencyUpdate) {\n prebuildCommand = `${prebuildCommand} --skip-dependency-update ${options.skipDependencyUpdate}`;\n }\n if (options?.clean) {\n prebuildCommand = `${prebuildCommand} --clean`;\n }\n const npxCommandPrefix = 'npx ';\n const expoCommandPrefix = 'expo ';\n const expoCliCommandPrefix = 'expo-cli ';\n if (prebuildCommand.startsWith(npxCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(npxCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCommandPrefix.length).trim();\n }\n if (prebuildCommand.startsWith(expoCliCommandPrefix)) {\n prebuildCommand = prebuildCommand.substring(expoCliCommandPrefix.length).trim();\n }\n if (!shouldUseGlobalExpoCli(ctx)) {\n prebuildCommand = prebuildCommand.replace(' --non-interactive', '');\n }\n return prebuildCommand.split(' ');\n}\n"]}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getEasFunctions = void 0;
|
|
4
|
-
const uploadArtifact_1 = require("./functions/uploadArtifact");
|
|
5
|
-
const checkout_1 = require("./functions/checkout");
|
|
6
|
-
const setUpNpmrc_1 = require("./functions/setUpNpmrc");
|
|
7
|
-
const installNodeModules_1 = require("./functions/installNodeModules");
|
|
8
|
-
const runGradle_1 = require("./functions/runGradle");
|
|
9
|
-
const prebuild_1 = require("./functions/prebuild");
|
|
10
|
-
const buildReactNativeApp_1 = require("./functions/buildReactNativeApp");
|
|
4
|
+
const uploadArtifact_1 = require("./functions/utils/uploadArtifact");
|
|
5
|
+
const checkout_1 = require("./functions/eas/checkout");
|
|
6
|
+
const setUpNpmrc_1 = require("./functions/eas/setUpNpmrc");
|
|
7
|
+
const installNodeModules_1 = require("./functions/eas/installNodeModules");
|
|
8
|
+
const runGradle_1 = require("./functions/utils/runGradle");
|
|
9
|
+
const prebuild_1 = require("./functions/eas/prebuild");
|
|
10
|
+
const buildReactNativeApp_1 = require("./functions/eas/buildReactNativeApp");
|
|
11
|
+
const findAndUploadBuildArtifacts_1 = require("./functions/eas/findAndUploadBuildArtifacts");
|
|
11
12
|
function getEasFunctions(ctx) {
|
|
12
13
|
return [
|
|
13
14
|
(0, checkout_1.createCheckoutBuildFunction)(),
|
|
@@ -17,6 +18,7 @@ function getEasFunctions(ctx) {
|
|
|
17
18
|
(0, prebuild_1.createPrebuildBuildFunction)(ctx),
|
|
18
19
|
(0, runGradle_1.createRunGradleBuildFunction)(ctx),
|
|
19
20
|
(0, buildReactNativeApp_1.createBuildReactNativeAppBuildFunction)(ctx),
|
|
21
|
+
(0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(ctx),
|
|
20
22
|
];
|
|
21
23
|
}
|
|
22
24
|
exports.getEasFunctions = getEasFunctions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAKA
|
|
1
|
+
{"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAKA,qEAAqF;AACrF,uDAAuE;AACvE,2DAA2E;AAC3E,2EAA2F;AAC3F,2DAA2E;AAC3E,uDAAuE;AACvE,6EAA6F;AAC7F,6FAA6G;AAE7G,SAAgB,eAAe,CAAgB,GAAoB;IACjE,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,0CAA6B,EAAC,GAAG,CAAC;QAClC,IAAA,0DAAqC,EAAC,GAAG,CAAC;QAC1C,IAAA,sCAA2B,EAAC,GAAG,CAAC;QAChC,IAAA,wCAA4B,EAAC,GAAG,CAAC;QACjC,IAAA,4DAAsC,EAAC,GAAG,CAAC;QAC3C,IAAA,4EAA8C,EAAC,GAAG,CAAC;KACpD,CAAC;AACJ,CAAC;AAXD,0CAWC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../context';\n\nimport { createUploadArtifactBuildFunction } from './functions/utils/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/eas/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/eas/setUpNpmrc';\nimport { createInstallNodeModulesBuildFunction } from './functions/eas/installNodeModules';\nimport { createRunGradleBuildFunction } from './functions/utils/runGradle';\nimport { createPrebuildBuildFunction } from './functions/eas/prebuild';\nimport { createBuildReactNativeAppBuildFunction } from './functions/eas/buildReactNativeApp';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/eas/findAndUploadBuildArtifacts';\n\nexport function getEasFunctions<T extends Job>(ctx: BuildContext<T>): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(ctx),\n createInstallNodeModulesBuildFunction(ctx),\n createPrebuildBuildFunction(ctx),\n createRunGradleBuildFunction(ctx),\n createBuildReactNativeAppBuildFunction(ctx),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n ];\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildFunction } from '@expo/steps';
|
|
3
|
-
import { BuildContext } from '
|
|
3
|
+
import { BuildContext } from '../../../context';
|
|
4
4
|
export declare function createBuildReactNativeAppBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
|
|
@@ -8,7 +8,7 @@ const path_1 = __importDefault(require("path"));
|
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
9
|
const steps_1 = require("@expo/steps");
|
|
10
10
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
|
-
const gradle_1 = require("
|
|
11
|
+
const gradle_1 = require("../../../android/gradle");
|
|
12
12
|
function createBuildReactNativeAppBuildFunction(ctx) {
|
|
13
13
|
return new steps_1.BuildFunction({
|
|
14
14
|
namespace: 'eas',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6D;AAC7D,uCAAoD;AACpD,wDAA0B;AAG1B,oDAAiF;AAEjF,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;oBAClC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,8BAA8B,UAAU,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CAC/S,CAAC;iBACH;gBACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACjD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;oBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,aAAa,EAAE,IAAA,6BAAoB,EAAC,GAAG,CAAC,GAAG,CAAC;oBAC5C,UAAU;iBACX,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,CAAC;aAC5E;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC","sourcesContent":["import path from 'path';\n\nimport { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../../android/gradle';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n throw new errors.BuildStepRuntimeError('iOS builds are not supported yet');\n }\n },\n });\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/checkout.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAC5C,wDAA0B;AAE1B,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YACvD,MAAM,kBAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB,EAAE;gBAC9E,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAZD,kEAYC","sourcesContent":["import { BuildFunction } from '@expo/steps';\nimport fs from 'fs-extra';\n\nexport function createCheckoutBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'checkout',\n name: 'Checkout',\n fn: async (stepsCtx) => {\n stepsCtx.logger.info('Checking out project directory');\n await fs.move(stepsCtx.projectSourceDirectory, stepsCtx.projectTargetDirectory, {\n overwrite: true,\n });\n },\n });\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createFindAndUploadBuildArtifactsBuildFunction = void 0;
|
|
4
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
5
|
+
const steps_1 = require("@expo/steps");
|
|
6
|
+
const artifacts_1 = require("../../../utils/artifacts");
|
|
7
|
+
const resolve_1 = require("../../../ios/resolve");
|
|
8
|
+
function createFindAndUploadBuildArtifactsBuildFunction(ctx) {
|
|
9
|
+
return new steps_1.BuildFunction({
|
|
10
|
+
namespace: 'eas',
|
|
11
|
+
id: 'find_and_upload_build_artifacts',
|
|
12
|
+
name: 'Find and upload build artifacts',
|
|
13
|
+
fn: async (stepsCtx) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const applicationArchivePatternOrPath = ctx.job.platform === eas_build_job_1.Platform.ANDROID
|
|
16
|
+
? (_a = ctx.job.applicationArchivePath) !== null && _a !== void 0 ? _a : 'android/app/build/outputs/**/*.{apk,aab}'
|
|
17
|
+
: (0, resolve_1.resolveArtifactPath)(ctx);
|
|
18
|
+
await (0, artifacts_1.uploadApplicationArchive)(ctx, {
|
|
19
|
+
logger: stepsCtx.logger,
|
|
20
|
+
rootDir: stepsCtx.workingDirectory,
|
|
21
|
+
patternOrPath: applicationArchivePatternOrPath,
|
|
22
|
+
});
|
|
23
|
+
await (0, artifacts_1.maybeFindAndUploadBuildArtifacts)(ctx, stepsCtx.logger);
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
exports.createFindAndUploadBuildArtifactsBuildFunction = createFindAndUploadBuildArtifactsBuildFunction;
|
|
28
|
+
//# sourceMappingURL=findAndUploadBuildArtifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAyD;AACzD,uCAA4C;AAG5C,wDAGkC;AAClC,kDAA2D;AAE3D,SAAgB,8CAA8C,CAC5D,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;YACrB,MAAM,+BAA+B,GACnC,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO;gBACnC,CAAC,CAAC,MAAA,GAAG,CAAC,GAAG,CAAC,sBAAsB,mCAAI,0CAA0C;gBAC9E,CAAC,CAAC,IAAA,6BAAmB,EAAC,GAA4B,CAAC,CAAC;YACxD,MAAM,IAAA,oCAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,OAAO,EAAE,QAAQ,CAAC,gBAAgB;gBAClC,aAAa,EAAE,+BAA+B;aAC/C,CAAC,CAAC;YACH,MAAM,IAAA,4CAAgC,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC/D,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AApBD,wGAoBC","sourcesContent":["import { Ios, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport {\n maybeFindAndUploadBuildArtifacts,\n uploadApplicationArchive,\n} from '../../../utils/artifacts';\nimport { resolveArtifactPath } from '../../../ios/resolve';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'find_and_upload_build_artifacts',\n name: 'Find and upload build artifacts',\n fn: async (stepsCtx) => {\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveArtifactPath(ctx as BuildContext<Ios.Job>);\n await uploadApplicationArchive(ctx, {\n logger: stepsCtx.logger,\n rootDir: stepsCtx.workingDirectory,\n patternOrPath: applicationArchivePatternOrPath,\n });\n await maybeFindAndUploadBuildArtifacts(ctx, stepsCtx.logger);\n },\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildFunction } from '@expo/steps';
|
|
3
|
-
import { BuildContext } from '
|
|
3
|
+
import { BuildContext } from '../../../context';
|
|
4
4
|
export declare function createInstallNodeModulesBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createInstallNodeModulesBuildFunction = void 0;
|
|
4
4
|
const steps_1 = require("@expo/steps");
|
|
5
|
-
const installDependencies_1 = require("
|
|
5
|
+
const installDependencies_1 = require("../../../common/installDependencies");
|
|
6
6
|
function createInstallNodeModulesBuildFunction(ctx) {
|
|
7
7
|
return new steps_1.BuildFunction({
|
|
8
8
|
namespace: 'eas',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installNodeModules.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/installNodeModules.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,6EAA+E;AAE/E,SAAgB,qCAAqC,CACnD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,8CAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAdD,sFAcC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport { installDependenciesAsync } from '../../../common/installDependencies';\n\nexport function createInstallNodeModulesBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_node_modules',\n name: 'Install node modules',\n fn: async (stepsCtx) => {\n await installDependenciesAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildFunction } from '@expo/steps';
|
|
3
|
-
import { BuildContext } from '
|
|
3
|
+
import { BuildContext } from '../../../context';
|
|
4
4
|
export declare function createPrebuildBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createPrebuildBuildFunction = void 0;
|
|
4
4
|
const steps_1 = require("@expo/steps");
|
|
5
|
-
const prebuild_1 = require("
|
|
5
|
+
const prebuild_1 = require("../../../common/prebuild");
|
|
6
6
|
function createPrebuildBuildFunction(ctx) {
|
|
7
7
|
return new steps_1.BuildFunction({
|
|
8
8
|
namespace: 'eas',
|
|
@@ -12,10 +12,12 @@ function createPrebuildBuildFunction(ctx) {
|
|
|
12
12
|
steps_1.BuildStepInput.createProvider({
|
|
13
13
|
id: 'skip_dependency_update',
|
|
14
14
|
defaultValue: false,
|
|
15
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
15
16
|
}),
|
|
16
17
|
steps_1.BuildStepInput.createProvider({
|
|
17
18
|
id: 'clean',
|
|
18
19
|
defaultValue: false,
|
|
20
|
+
allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
|
|
19
21
|
}),
|
|
20
22
|
steps_1.BuildStepInput.createProvider({
|
|
21
23
|
id: 'apple_team_id',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/prebuild.ts"],"names":[],"mappings":";;;AACA,uCAAyF;AAGzF,uDAAyD;AAEzD,SAAgB,2BAA2B,CAAgB,GAAoB;IAC7E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,wBAAwB;gBAC5B,YAAY,EAAE,KAAK;gBACnB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,YAAY,EAAE,KAAK;gBACnB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,eAAe;gBACnB,QAAQ,EAAE,KAAK;aAChB,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;;YACjC,kGAAkG;YAClG,MAAM,SAAS,GAA2B,MAAM,CAAC,aAAa,CAAC,KAAK;gBAClE,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE;gBAC1D,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,IAAA,wBAAa,EAAC,GAAG,EAAE;gBACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;gBACrC,OAAO,EAAE;oBACP,SAAS;oBACT,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;oBAC3B,oBAAoB,EAAE,MAAA,MAAM,CAAC,sBAAsB,CAAC,KAAK,0CAAE,QAAQ,EAAE;iBACtE;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AArCD,kEAqCC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport { prebuildAsync } from '../../../common/prebuild';\n\nexport function createPrebuildBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'prebuild',\n name: 'Prebuild',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'skip_dependency_update',\n defaultValue: false,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n BuildStepInput.createProvider({\n id: 'clean',\n defaultValue: false,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n BuildStepInput.createProvider({\n id: 'apple_team_id',\n required: false,\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n // TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds\n const extraEnvs: Record<string, string> = inputs.apple_team_id.value\n ? { APPLE_TEAM_ID: inputs.apple_team_id.value.toString() }\n : {};\n await prebuildAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n options: {\n extraEnvs,\n clean: !!inputs.clean.value,\n skipDependencyUpdate: inputs.skip_dependency_update.value?.toString(),\n },\n });\n },\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildFunction } from '@expo/steps';
|
|
3
|
-
import { BuildContext } from '
|
|
3
|
+
import { BuildContext } from '../../../context';
|
|
4
4
|
export declare function createSetUpNpmrcBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createSetUpNpmrcBuildFunction = void 0;
|
|
4
4
|
const steps_1 = require("@expo/steps");
|
|
5
|
-
const npmrc_1 = require("
|
|
5
|
+
const npmrc_1 = require("../../../utils/npmrc");
|
|
6
6
|
function createSetUpNpmrcBuildFunction(ctx) {
|
|
7
7
|
return new steps_1.BuildFunction({
|
|
8
8
|
namespace: 'eas',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setUpNpmrc.js","sourceRoot":"","sources":["../../../../src/steps/functions/eas/setUpNpmrc.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,gDAAuD;AAEvD,SAAgB,6BAA6B,CAAgB,GAAoB;IAC/E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,uBAAe,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AATD,sEASC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../../context';\nimport { setUpNpmrcAsync } from '../../../utils/npmrc';\n\nexport function createSetUpNpmrcBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'use_npm_token',\n name: 'Use NPM_TOKEN',\n fn: async (stepsCtx) => {\n await setUpNpmrcAsync(ctx, stepsCtx.logger);\n },\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildFunction } from '@expo/steps';
|
|
3
|
-
import { BuildContext } from '
|
|
3
|
+
import { BuildContext } from '../../../context';
|
|
4
4
|
export declare function createRunGradleBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
|
|
@@ -4,10 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.createRunGradleBuildFunction = void 0;
|
|
7
|
-
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
8
7
|
const steps_1 = require("@expo/steps");
|
|
9
8
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
10
|
-
const gradle_1 = require("
|
|
9
|
+
const gradle_1 = require("../../../android/gradle");
|
|
11
10
|
function createRunGradleBuildFunction(ctx) {
|
|
12
11
|
return new steps_1.BuildFunction({
|
|
13
12
|
namespace: 'utils',
|
|
@@ -20,9 +19,6 @@ function createRunGradleBuildFunction(ctx) {
|
|
|
20
19
|
}),
|
|
21
20
|
],
|
|
22
21
|
fn: async (stepsCtx, { inputs }) => {
|
|
23
|
-
if (ctx.job.platform !== eas_build_job_1.Platform.ANDROID) {
|
|
24
|
-
throw new steps_1.errors.BuildStepRuntimeError('This step is only supported for Android');
|
|
25
|
-
}
|
|
26
22
|
await (0, gradle_1.runGradleCommand)(ctx, {
|
|
27
23
|
logger: stepsCtx.logger,
|
|
28
24
|
gradleCommand: (0, nullthrows_1.default)(inputs.gradle_command.value).toString(),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runGradle.js","sourceRoot":"","sources":["../../../../src/steps/functions/utils/runGradle.ts"],"names":[],"mappings":";;;;;;AACA,uCAA4D;AAC5D,4DAAoC;AAGpC,oDAA2D;AAE3D,SAAgB,4BAA4B,CAAgB,GAAoB;IAC9E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,OAAO;QAClB,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,gBAAgB;gBACpB,YAAY,EAAE,oBAAoB;aACnC,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;gBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,aAAa,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBACjE,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAnBD,oEAmBC","sourcesContent":["import { Android, Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { BuildContext } from '../../../context';\nimport { runGradleCommand } from '../../../android/gradle';\n\nexport function createRunGradleBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'utils',\n id: 'run_gradle',\n name: 'Run Gradle',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'gradle_command',\n defaultValue: ':app:bundleRelease',\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: nullthrows(inputs.gradle_command.value).toString(),\n androidDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Job } from '@expo/eas-build-job';
|
|
2
2
|
import { BuildFunction } from '@expo/steps';
|
|
3
|
-
import { BuildContext } from '
|
|
3
|
+
import { BuildContext } from '../../../context';
|
|
4
4
|
export declare function createUploadArtifactBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction;
|
|
@@ -7,7 +7,7 @@ exports.createUploadArtifactBuildFunction = void 0;
|
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const steps_1 = require("@expo/steps");
|
|
9
9
|
const nullthrows_1 = __importDefault(require("nullthrows"));
|
|
10
|
-
const context_1 = require("
|
|
10
|
+
const context_1 = require("../../../context");
|
|
11
11
|
var BuildArtifactType;
|
|
12
12
|
(function (BuildArtifactType) {
|
|
13
13
|
BuildArtifactType["APPLICATION_ARCHIVE"] = "application-archive";
|
|
@@ -15,7 +15,7 @@ var BuildArtifactType;
|
|
|
15
15
|
})(BuildArtifactType || (BuildArtifactType = {}));
|
|
16
16
|
function createUploadArtifactBuildFunction(ctx) {
|
|
17
17
|
return new steps_1.BuildFunction({
|
|
18
|
-
namespace: '
|
|
18
|
+
namespace: 'utils',
|
|
19
19
|
id: 'upload_artifact',
|
|
20
20
|
name: 'Upload artifact',
|
|
21
21
|
inputProviders: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../../../src/steps/functions/utils/uploadArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,uCAA4D;AAC5D,4DAAoC;AAEpC,8CAA8D;AAE9D,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,gEAA2C,CAAA;IAC3C,sDAAiC,CAAA;AACnC,CAAC,EAHI,iBAAiB,KAAjB,iBAAiB,QAGrB;AAED,SAAgB,iCAAiC,CAC/C,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,OAAO;QAClB,EAAE,EAAE,iBAAiB;QACrB,IAAI,EAAE,iBAAiB;QACvB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,MAAM;gBACV,YAAY,EAAE,iBAAiB,CAAC,mBAAmB;gBACnD,aAAa,EAAE,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,iBAAiB,CAAC,cAAc,CAAC;aACzF,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAC9D;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,MAAM,YAAY,GAAG,mCAAmC,CACtD,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CACzC,CAAC;YACF,MAAM,QAAQ,GAAG,cAAI,CAAC,OAAO,CAC3B,QAAQ,CAAC,gBAAgB,EACzB,IAAA,oBAAU,EAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CACzC,CAAC;YACF,MAAM,GAAG,CAAC,eAAe,CAAC,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QACvE,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1BD,8EA0BC;AAED,SAAS,mCAAmC,CAAC,KAAa;IACxD,MAAM,aAAa,GAAa,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACjE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAClC,MAAM,IAAI,KAAK,CACb,IAAI,KAAK,mDAAmD,aAAa;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;KACH;IACD,OAAO,KAAK,KAAK,iBAAiB,CAAC,mBAAmB;QACpD,CAAC,CAAC,sBAAY,CAAC,mBAAmB;QAClC,CAAC,CAAC,sBAAY,CAAC,eAAe,CAAC;AACnC,CAAC","sourcesContent":["import path from 'path';\n\nimport { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { ArtifactType, BuildContext } from '../../../context';\n\nenum BuildArtifactType {\n APPLICATION_ARCHIVE = 'application-archive',\n BUILD_ARTIFACT = 'build-artifact',\n}\n\nexport function createUploadArtifactBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'utils',\n id: 'upload_artifact',\n name: 'Upload artifact',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'type',\n defaultValue: BuildArtifactType.APPLICATION_ARCHIVE,\n allowedValues: [BuildArtifactType.APPLICATION_ARCHIVE, BuildArtifactType.BUILD_ARTIFACT],\n }),\n BuildStepInput.createProvider({ id: 'path', required: true }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const artifactType = validateAndConvertBuildArtifactType(\n nullthrows(inputs.type.value).toString()\n );\n const filePath = path.resolve(\n stepsCtx.workingDirectory,\n nullthrows(inputs.path.value).toString()\n );\n await ctx.uploadArtifacts(artifactType, [filePath], stepsCtx.logger);\n },\n });\n}\n\nfunction validateAndConvertBuildArtifactType(input: string): ArtifactType {\n const allowedValues: string[] = Object.values(BuildArtifactType);\n if (!allowedValues.includes(input)) {\n throw new Error(\n `\"${input}\" is not allowed artifact type, allowed values: ${allowedValues\n .map((i) => `\"${i}\"`)\n .join(', ')}`\n );\n }\n return input === BuildArtifactType.APPLICATION_ARCHIVE\n ? ArtifactType.APPLICATION_ARCHIVE\n : ArtifactType.BUILD_ARTIFACTS;\n}\n"]}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
1
|
/// <reference types="bunyan" />
|
|
2
2
|
import { bunyan } from '@expo/logger';
|
|
3
|
+
import { Job } from '@expo/eas-build-job';
|
|
4
|
+
import { BuildContext } from '../context';
|
|
3
5
|
export declare function findArtifacts(rootDir: string, patternOrPath: string, buildLogger: bunyan): Promise<string[]>;
|
|
6
|
+
export declare function maybeFindAndUploadBuildArtifacts(ctx: BuildContext<Job>, logger: bunyan): Promise<void>;
|
|
7
|
+
export declare function uploadApplicationArchive(ctx: BuildContext<Job>, { logger, patternOrPath, rootDir, }: {
|
|
8
|
+
logger: bunyan;
|
|
9
|
+
patternOrPath: string;
|
|
10
|
+
rootDir: string;
|
|
11
|
+
}): Promise<void>;
|
package/dist/utils/artifacts.js
CHANGED
|
@@ -3,10 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.findArtifacts = void 0;
|
|
6
|
+
exports.uploadApplicationArchive = exports.maybeFindAndUploadBuildArtifacts = exports.findArtifacts = void 0;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
9
|
const fast_glob_1 = __importDefault(require("fast-glob"));
|
|
10
|
+
const context_1 = require("../context");
|
|
10
11
|
async function findArtifacts(rootDir, patternOrPath, buildLogger) {
|
|
11
12
|
const files = await (0, fast_glob_1.default)(patternOrPath, { cwd: rootDir, onlyFiles: false });
|
|
12
13
|
if (files.length === 0) {
|
|
@@ -38,4 +39,24 @@ async function logMissingFileError(artifactPath, buildLogger) {
|
|
|
38
39
|
buildLogger.error(`There is no such file or directory "${artifactPath}". Directory "${currentPath}" contains [${dirContent.join(', ')}].`);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
42
|
+
async function maybeFindAndUploadBuildArtifacts(ctx, logger) {
|
|
43
|
+
if (!ctx.job.buildArtifactPaths || ctx.job.buildArtifactPaths.length === 0) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
try {
|
|
47
|
+
const buildArtifacts = (await Promise.all(ctx.job.buildArtifactPaths.map((path) => findArtifacts(ctx.getReactNativeProjectDirectory(), path, logger)))).flat();
|
|
48
|
+
logger.info(`Uploading build artifacts: ${buildArtifacts.join(', ')}`);
|
|
49
|
+
await ctx.uploadArtifacts(context_1.ArtifactType.BUILD_ARTIFACTS, buildArtifacts, logger);
|
|
50
|
+
}
|
|
51
|
+
catch (err) {
|
|
52
|
+
logger.error({ err }, 'Failed to upload build artifacts');
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.maybeFindAndUploadBuildArtifacts = maybeFindAndUploadBuildArtifacts;
|
|
56
|
+
async function uploadApplicationArchive(ctx, { logger, patternOrPath, rootDir, }) {
|
|
57
|
+
const applicationArchives = await findArtifacts(rootDir, patternOrPath, logger);
|
|
58
|
+
logger.info(`Application archives: ${applicationArchives.join(', ')}`);
|
|
59
|
+
await ctx.uploadArtifacts(context_1.ArtifactType.APPLICATION_ARCHIVE, applicationArchives, logger);
|
|
60
|
+
}
|
|
61
|
+
exports.uploadApplicationArchive = uploadApplicationArchive;
|
|
41
62
|
//# sourceMappingURL=artifacts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/utils/artifacts.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,0DAA2B;
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/utils/artifacts.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,wDAA0B;AAC1B,0DAA2B;AAI3B,wCAAwD;AAEjD,KAAK,UAAU,aAAa,CACjC,OAAe,EACf,aAAqB,EACrB,WAAmB;IAEnB,MAAM,KAAK,GAAG,MAAM,IAAA,mBAAE,EAAC,aAAa,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1E,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACtB,IAAI,mBAAE,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE;YACtC,MAAM,IAAI,KAAK,CAAC,wCAAwC,aAAa,GAAG,CAAC,CAAC;SAC3E;aAAM;YACL,MAAM,mBAAmB,CAAC,cAAI,CAAC,IAAI,CAAC,OAAO,EAAE,aAAa,CAAC,EAAE,WAAW,CAAC,CAAC;YAC1E,MAAM,IAAI,KAAK,CAAC,6BAA6B,aAAa,EAAE,CAAC,CAAC;SAC/D;KACF;IACD,OAAO,KAAK,CAAC,G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AAC,8BAA8B,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,CAClE,CACF,CACF,CAAC,IAAI,EAAE,CAAC;QACT,MAAM,CAAC,IAAI,CAAC,8BAA8B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACvE,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,eAAe,EAAE,cAAc,EAAE,MAAM,CAAC,CAAC;KACjF;IAAC,OAAO,GAAQ,EAAE;QACjB,MAAM,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,EAAE,kCAAkC,CAAC,CAAC;KAC3D;AACH,CAAC;AApBD,4EAoBC;AAEM,KAAK,UAAU,wBAAwB,CAC5C,GAAsB,EACtB,EACE,MAAM,EACN,aAAa,EACb,OAAO,GAKR;IAED,MAAM,mBAAmB,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IAChF,MAAM,CAAC,IAAI,CAAC,yBAAyB,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACvE,MAAM,GAAG,CAAC,eAAe,CAAC,sBAAY,CAAC,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,CAAC,CAAC;AAC3F,CAAC;AAfD,4DAeC","sourcesContent":["import path from 'path';\n\nimport fs from 'fs-extra';\nimport fg from 'fast-glob';\nimport { bunyan } from '@expo/logger';\nimport { Job } from '@expo/eas-build-job';\n\nimport { ArtifactType, BuildContext } from '../context';\n\nexport async function findArtifacts(\n rootDir: string,\n patternOrPath: string,\n buildLogger: bunyan\n): Promise<string[]> {\n const files = await fg(patternOrPath, { cwd: rootDir, onlyFiles: false });\n if (files.length === 0) {\n if (fg.isDynamicPattern(patternOrPath)) {\n throw new Error(`There are no files matching pattern \"${patternOrPath}\"`);\n } else {\n await logMissingFileError(path.join(rootDir, patternOrPath), buildLogger);\n throw new Error(`No such file or directory ${patternOrPath}`);\n }\n }\n return files.map((relativePath) => path.join(rootDir, relativePath));\n}\n\nasync function logMissingFileError(artifactPath: string, buildLogger: bunyan): Promise<void> {\n let currentPath = artifactPath;\n while (!(await fs.pathExists(currentPath))) {\n currentPath = path.resolve(currentPath, '..');\n }\n if (currentPath === path.resolve(currentPath, '..')) {\n buildLogger.error(`There is no such file or directory \"${artifactPath}\".`);\n return;\n }\n const dirContent = await fs.readdir(currentPath);\n if (dirContent.length === 0) {\n buildLogger.error(\n `There is no such file or directory \"${artifactPath}\". Directory \"${currentPath}\" is empty.`\n );\n } else {\n buildLogger.error(\n `There is no such file or directory \"${artifactPath}\". Directory \"${currentPath}\" contains [${dirContent.join(\n ', '\n )}].`\n );\n }\n}\n\nexport async function maybeFindAndUploadBuildArtifacts(\n ctx: BuildContext<Job>,\n logger: bunyan\n): Promise<void> {\n if (!ctx.job.buildArtifactPaths || ctx.job.buildArtifactPaths.length === 0) {\n return;\n }\n try {\n const buildArtifacts = (\n await Promise.all(\n ctx.job.buildArtifactPaths.map((path) =>\n findArtifacts(ctx.getReactNativeProjectDirectory(), path, logger)\n )\n )\n ).flat();\n logger.info(`Uploading build artifacts: ${buildArtifacts.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.BUILD_ARTIFACTS, buildArtifacts, logger);\n } catch (err: any) {\n logger.error({ err }, 'Failed to upload build artifacts');\n }\n}\n\nexport async function uploadApplicationArchive(\n ctx: BuildContext<Job>,\n {\n logger,\n patternOrPath,\n rootDir,\n }: {\n logger: bunyan;\n patternOrPath: string;\n rootDir: string;\n }\n): Promise<void> {\n const applicationArchives = await findArtifacts(rootDir, patternOrPath, logger);\n logger.info(`Application archives: ${applicationArchives.join(', ')}`);\n await ctx.uploadArtifacts(ArtifactType.APPLICATION_ARCHIVE, applicationArchives, logger);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@expo/logger": "1.0.21",
|
|
28
28
|
"@expo/package-manager": "^0.0.57",
|
|
29
29
|
"@expo/plist": "^0.0.20",
|
|
30
|
-
"@expo/steps": "1.0.
|
|
30
|
+
"@expo/steps": "1.0.23",
|
|
31
31
|
"@expo/template-file": "1.0.13",
|
|
32
32
|
"@expo/turtle-spawn": "1.0.21",
|
|
33
33
|
"@expo/xcpretty": "^4.2.2",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"node": "18.13.0",
|
|
62
62
|
"yarn": "1.22.19"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "40fb0b2ffecf14b2cbd63dc51b910cf486351783"
|
|
65
65
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"buildReactNativeApp.js","sourceRoot":"","sources":["../../../src/steps/functions/buildReactNativeApp.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6D;AAC7D,uCAAoD;AACpD,wDAA0B;AAG1B,iDAA8E;AAE9E,SAAgB,sCAAsC,CACpD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,wBAAwB;QAC5B,IAAI,EAAE,wBAAwB;QAC9B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,UAAU,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;gBACnE,IAAI,CAAC,CAAC,MAAM,kBAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;oBAClC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CACpC,8BAA8B,UAAU,yEAAyE,QAAQ,CAAC,gBAAgB,oKAAoK,CAC/S,CAAC;iBACH;gBACD,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACjD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;oBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;oBACvB,aAAa,EAAE,IAAA,6BAAoB,EAAC,GAAG,CAAC,GAAG,CAAC;oBAC5C,UAAU;iBACX,CAAC,CAAC;aACJ;iBAAM;gBACL,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,kCAAkC,CAAC,CAAC;aAC5E;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA1BD,wFA0BC","sourcesContent":["import path from 'path';\n\nimport { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, errors } from '@expo/steps';\nimport fs from 'fs-extra';\n\nimport { BuildContext } from '../../context';\nimport { resolveGradleCommand, runGradleCommand } from '../../android/gradle';\n\nexport function createBuildReactNativeAppBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'build_react_native_app',\n name: 'Build React Native app',\n fn: async (stepsCtx) => {\n if (ctx.job.platform === Platform.ANDROID) {\n const androidDir = path.join(stepsCtx.workingDirectory, 'android');\n if (!(await fs.exists(androidDir))) {\n throw new errors.BuildStepRuntimeError(\n `Android project directory (${androidDir}) does not exist. Make sure that the working directory for this step (${stepsCtx.workingDirectory}) is set to the root of your React Native project. If you are on a managed workflow, make sure that you have run \"eas/prebuild\" step to generate your native code.`\n );\n }\n stepsCtx.logger.info('Building Android project');\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: resolveGradleCommand(ctx.job),\n androidDir,\n });\n } else {\n throw new errors.BuildStepRuntimeError('iOS builds are not supported yet');\n }\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/steps/functions/checkout.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAC5C,wDAA0B;AAE1B,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;YACvD,MAAM,kBAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,sBAAsB,EAAE,QAAQ,CAAC,sBAAsB,EAAE;gBAC9E,SAAS,EAAE,IAAI;aAChB,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAZD,kEAYC","sourcesContent":["import { BuildFunction } from '@expo/steps';\nimport fs from 'fs-extra';\n\nexport function createCheckoutBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'checkout',\n name: 'Checkout',\n fn: async (stepsCtx) => {\n stepsCtx.logger.info('Checking out project directory');\n await fs.move(stepsCtx.projectSourceDirectory, stepsCtx.projectTargetDirectory, {\n overwrite: true,\n });\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"installNodeModules.js","sourceRoot":"","sources":["../../../src/steps/functions/installNodeModules.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,0EAA4E;AAE5E,SAAgB,qCAAqC,CACnD,GAAoB;IAEpB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,8CAAwB,EAAC,GAAG,EAAE;gBAClC,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAdD,sFAcC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../context';\nimport { installDependenciesAsync } from '../../common/installDependencies';\n\nexport function createInstallNodeModulesBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_node_modules',\n name: 'Install node modules',\n fn: async (stepsCtx) => {\n await installDependenciesAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prebuild.js","sourceRoot":"","sources":["../../../src/steps/functions/prebuild.ts"],"names":[],"mappings":";;;AACA,uCAA4D;AAG5D,oDAAsD;AAEtD,SAAgB,2BAA2B,CAAgB,GAAoB;IAC7E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,UAAU;QAChB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,wBAAwB;gBAC5B,YAAY,EAAE,KAAK;aACpB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,YAAY,EAAE,KAAK;aACpB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,eAAe;gBACnB,QAAQ,EAAE,KAAK;aAChB,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;;YACjC,kGAAkG;YAClG,MAAM,SAAS,GAA2B,MAAM,CAAC,aAAa,CAAC,KAAK;gBAClE,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE;gBAC1D,CAAC,CAAC,EAAE,CAAC;YACP,MAAM,IAAA,wBAAa,EAAC,GAAG,EAAE;gBACvB,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,gBAAgB;gBACrC,OAAO,EAAE;oBACP,SAAS;oBACT,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK;oBAC3B,oBAAoB,EAAE,MAAA,MAAM,CAAC,sBAAsB,CAAC,KAAK,0CAAE,QAAQ,EAAE;iBACtE;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAnCD,kEAmCC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\n\nimport { BuildContext } from '../../context';\nimport { prebuildAsync } from '../../common/prebuild';\n\nexport function createPrebuildBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'prebuild',\n name: 'Prebuild',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'skip_dependency_update',\n defaultValue: false,\n }),\n BuildStepInput.createProvider({\n id: 'clean',\n defaultValue: false,\n }),\n BuildStepInput.createProvider({\n id: 'apple_team_id',\n required: false,\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n // TODO: make sure we can pass Apple Team ID to prebuild when adding credentials for custom builds\n const extraEnvs: Record<string, string> = inputs.apple_team_id.value\n ? { APPLE_TEAM_ID: inputs.apple_team_id.value.toString() }\n : {};\n await prebuildAsync(ctx, {\n logger: stepsCtx.logger,\n workingDir: stepsCtx.workingDirectory,\n options: {\n extraEnvs,\n clean: !!inputs.clean.value,\n skipDependencyUpdate: inputs.skip_dependency_update.value?.toString(),\n },\n });\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runGradle.js","sourceRoot":"","sources":["../../../src/steps/functions/runGradle.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA6D;AAC7D,uCAAoE;AACpE,4DAAoC;AAGpC,iDAAwD;AAExD,SAAgB,4BAA4B,CAAgB,GAAoB;IAC9E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,OAAO;QAClB,EAAE,EAAE,YAAY;QAChB,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,gBAAgB;gBACpB,YAAY,EAAE,oBAAoB;aACnC,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;YACjC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,EAAE;gBACzC,MAAM,IAAI,cAAM,CAAC,qBAAqB,CAAC,yCAAyC,CAAC,CAAC;aACnF;YACD,MAAM,IAAA,yBAAgB,EAAC,GAAgC,EAAE;gBACvD,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,aAAa,EAAE,IAAA,oBAAU,EAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;gBACjE,UAAU,EAAE,QAAQ,CAAC,gBAAgB;aACtC,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAtBD,oEAsBC","sourcesContent":["import { Android, Job, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput, errors } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { BuildContext } from '../../context';\nimport { runGradleCommand } from '../../android/gradle';\n\nexport function createRunGradleBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'utils',\n id: 'run_gradle',\n name: 'Run Gradle',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'gradle_command',\n defaultValue: ':app:bundleRelease',\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n if (ctx.job.platform !== Platform.ANDROID) {\n throw new errors.BuildStepRuntimeError('This step is only supported for Android');\n }\n await runGradleCommand(ctx as BuildContext<Android.Job>, {\n logger: stepsCtx.logger,\n gradleCommand: nullthrows(inputs.gradle_command.value).toString(),\n androidDir: stepsCtx.workingDirectory,\n });\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setUpNpmrc.js","sourceRoot":"","sources":["../../../src/steps/functions/setUpNpmrc.ts"],"names":[],"mappings":";;;AACA,uCAA4C;AAG5C,6CAAoD;AAEpD,SAAgB,6BAA6B,CAAgB,GAAoB;IAC/E,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;YACrB,MAAM,IAAA,uBAAe,EAAC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC9C,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AATD,sEASC","sourcesContent":["import { Job } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { BuildContext } from '../../context';\nimport { setUpNpmrcAsync } from '../../utils/npmrc';\n\nexport function createSetUpNpmrcBuildFunction<T extends Job>(ctx: BuildContext<T>): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'use_npm_token',\n name: 'Use NPM_TOKEN',\n fn: async (stepsCtx) => {\n await setUpNpmrcAsync(ctx, stepsCtx.logger);\n },\n });\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uploadArtifact.js","sourceRoot":"","sources":["../../../src/steps/functions/uploadArtifact.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,uCAA4D;AAC5D,4DAAoC;AAEpC,2CAA2D;AAE3D,IAAK,iBAGJ;AAHD,WAAK,iBAAiB;IACpB,gEAA2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AK,CACb,IAAI,KAAK,mDAAmD,aAAa;aACtE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;aACpB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;KACH;IACD,OAAO,KAAK,KAAK,iBAAiB,CAAC,mBAAmB;QACpD,CAAC,CAAC,sBAAY,CAAC,mBAAmB;QAClC,CAAC,CAAC,sBAAY,CAAC,eAAe,CAAC;AACnC,CAAC","sourcesContent":["import path from 'path';\n\nimport { Job } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepInput } from '@expo/steps';\nimport nullthrows from 'nullthrows';\n\nimport { ArtifactType, BuildContext } from '../../context';\n\nenum BuildArtifactType {\n APPLICATION_ARCHIVE = 'application-archive',\n BUILD_ARTIFACT = 'build-artifact',\n}\n\nexport function createUploadArtifactBuildFunction<T extends Job>(\n ctx: BuildContext<T>\n): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'upload_artifact',\n name: 'Upload artifact',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'type',\n defaultValue: BuildArtifactType.APPLICATION_ARCHIVE,\n allowedValues: [BuildArtifactType.APPLICATION_ARCHIVE, BuildArtifactType.BUILD_ARTIFACT],\n }),\n BuildStepInput.createProvider({ id: 'path', required: true }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const artifactType = validateAndConvertBuildArtifactType(\n nullthrows(inputs.type.value).toString()\n );\n const filePath = path.resolve(\n stepsCtx.workingDirectory,\n nullthrows(inputs.path.value).toString()\n );\n await ctx.uploadArtifacts(artifactType, [filePath], stepsCtx.logger);\n },\n });\n}\n\nfunction validateAndConvertBuildArtifactType(input: string): ArtifactType {\n const allowedValues: string[] = Object.values(BuildArtifactType);\n if (!allowedValues.includes(input)) {\n throw new Error(\n `\"${input}\" is not allowed artifact type, allowed values: ${allowedValues\n .map((i) => `\"${i}\"`)\n .join(', ')}`\n );\n }\n return input === BuildArtifactType.APPLICATION_ARCHIVE\n ? ArtifactType.APPLICATION_ARCHIVE\n : ArtifactType.BUILD_ARTIFACTS;\n}\n"]}
|
|
File without changes
|
|
File without changes
|