@expo/build-tools 1.0.184 → 1.0.186

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.
@@ -1 +1 @@
1
- {"version":3,"file":"createSubmissionEntity.js","sourceRoot":"","sources":["../../../src/steps/functions/createSubmissionEntity.ts"],"names":[],"mappings":";;;AAAA,uCAAyF;AACzF,2CAA4C;AAE5C,qEAAkE;AAElE,SAAgB,8BAA8B;IAC5C,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,0BAA0B;QAC9B,IAAI,EAAE,0BAA0B;QAChC,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,IAAI;aACf,CAAC;YAEF,0BAA0B;YAC1B,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,gBAAgB;gBACpB,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,SAAS;gBACb,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,6BAA6B;gBACjC,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;gBACzD,QAAQ,EAAE,KAAK;aAChB,CAAC;YAEF,sBAAsB;YACtB,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,mBAAmB;gBACvB,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;g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AAM,IAAI,GAAG,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC;gBACnC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,IAAI,CAAC,EAAE,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACpF,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/HD,wEA+HC","sourcesContent":["import { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { asyncResult } from '@expo/results';\n\nimport { retryOnDNSFailure } from '../../utils/retryOnDNSFailure';\n\nexport function createSubmissionEntityFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'create_submission_entity',\n name: 'Create Submission Entity',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'build_id',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: true,\n }),\n\n // AndroidSubmissionConfig\n BuildStepInput.createProvider({\n id: 'track',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'release_status',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'rollout',\n allowedValueTypeName: BuildStepInputValueTypeName.NUMBER,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'changes_not_sent_for_review',\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n required: false,\n }),\n\n // IosSubmissionConfig\n BuildStepInput.createProvider({\n id: 'apple_id_username',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'asc_app_identifier',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const robotAccessToken = stepsCtx.global.staticContext.job.secrets?.robotAccessToken;\n if (!robotAccessToken) {\n stepsCtx.logger.error('Failed to create submission entity: no robot access token found');\n return;\n }\n\n const buildId = inputs.build_id.value;\n if (!buildId) {\n stepsCtx.logger.error('Failed to create submission entity: no build ID provided');\n return;\n }\n\n const workflowJobId = stepsCtx.global.staticContext.env.__WORKFLOW_JOB_ID;\n if (!workflowJobId) {\n stepsCtx.logger.error('Failed to create submission entity: no workflow job ID found');\n return;\n }\n\n // This is supposed to provide fallback for `''` -> `undefined`.\n // We _not_ want to use nullish coalescing.\n /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n const track = inputs.track.value || undefined;\n const releaseStatus = inputs.release_status.value || undefined;\n const rollout = inputs.rollout.value || undefined;\n const changesNotSentForReview = inputs.changes_not_sent_for_review.value || undefined;\n\n const appleIdUsername = inputs.apple_id_username.value || undefined;\n const ascAppIdentifier = inputs.asc_app_identifier.value || undefined;\n /* eslint-enable @typescript-eslint/prefer-nullish-coalescing */\n\n try {\n const response = await retryOnDNSFailure(fetch)(\n new URL('/v2/app-store-submissions/', stepsCtx.global.staticContext.expoApiServerURL),\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${robotAccessToken}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n workflowJobId,\n turtleBuildId: buildId,\n // We can pass mixed object here because the configs are disjoint.\n config: {\n // AndroidSubmissionConfig\n track,\n releaseStatus,\n rollout,\n changesNotSentForReview,\n\n // IosSubmissionConfig\n appleIdUsername,\n ascAppIdentifier,\n },\n }),\n }\n );\n\n if (!response.ok) {\n const textResult = await asyncResult(response.text());\n throw new Error(\n `Unexpected response from server (${response.status}): ${textResult.value}`\n );\n }\n\n const jsonResult = await asyncResult(response.json());\n if (!jsonResult.ok) {\n stepsCtx.logger.warn(\n `Submission created. Failed to parse response. ${jsonResult.reason}`\n );\n return;\n }\n\n const data = jsonResult.value.data;\n stepsCtx.logger.info(`Submission created:\\n ID: ${data.id}\\n URL: ${data.url}`);\n } catch (e) {\n stepsCtx.logger.error(`Failed to create submission entity. ${e}`);\n }\n },\n });\n}\n"]}
1
+ {"version":3,"file":"createSubmissionEntity.js","sourceRoot":"","sources":["../../../src/steps/functions/createSubmissionEntity.ts"],"names":[],"mappings":";;;AAAA,uCAAyF;AACzF,2CAA4C;AAE5C,qEAAkE;AAElE,SAAgB,8BAA8B;IAC5C,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,0BAA0B;QAC9B,IAAI,EAAE,0BAA0B;QAChC,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,IAAI;aACf,CAAC;YAEF,0BAA0B;YAC1B,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,OAAO;gBACX,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,gBAAgB;gBACpB,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,SAAS;gBACb,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,6BAA6B;gBACjC,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;gBACzD,QAAQ,EAAE,KAAK;aAChB,CAAC;YAEF,sBAAsB;YACtB,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,mBAAmB;gBACvB,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBA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C,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,8BAA8B,IAAI,CAAC,EAAE,YAAY,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;YACpF,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,EAAE,CAAC,CAAC;YACpE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/HD,wEA+HC","sourcesContent":["import { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { asyncResult } from '@expo/results';\n\nimport { retryOnDNSFailure } from '../../utils/retryOnDNSFailure';\n\nexport function createSubmissionEntityFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'create_submission_entity',\n name: 'Create Submission Entity',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'build_id',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: true,\n }),\n\n // AndroidSubmissionConfig\n BuildStepInput.createProvider({\n id: 'track',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'release_status',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'rollout',\n allowedValueTypeName: BuildStepInputValueTypeName.NUMBER,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'changes_not_sent_for_review',\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n required: false,\n }),\n\n // IosSubmissionConfig\n BuildStepInput.createProvider({\n id: 'apple_id_username',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'asc_app_identifier',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n ],\n fn: async (stepsCtx, { inputs }) => {\n const robotAccessToken = stepsCtx.global.staticContext.job.secrets?.robotAccessToken;\n if (!robotAccessToken) {\n stepsCtx.logger.error('Failed to create submission entity: no robot access token found');\n return;\n }\n\n const buildId = inputs.build_id.value;\n if (!buildId) {\n stepsCtx.logger.error('Failed to create submission entity: no build ID provided');\n return;\n }\n\n const workflowJobId = stepsCtx.global.env.__WORKFLOW_JOB_ID;\n if (!workflowJobId) {\n stepsCtx.logger.error('Failed to create submission entity: no workflow job ID found');\n return;\n }\n\n // This is supposed to provide fallback for `''` -> `undefined`.\n // We _not_ want to use nullish coalescing.\n /* eslint-disable @typescript-eslint/prefer-nullish-coalescing */\n const track = inputs.track.value || undefined;\n const releaseStatus = inputs.release_status.value || undefined;\n const rollout = inputs.rollout.value || undefined;\n const changesNotSentForReview = inputs.changes_not_sent_for_review.value || undefined;\n\n const appleIdUsername = inputs.apple_id_username.value || undefined;\n const ascAppIdentifier = inputs.asc_app_identifier.value || undefined;\n /* eslint-enable @typescript-eslint/prefer-nullish-coalescing */\n\n try {\n const response = await retryOnDNSFailure(fetch)(\n new URL('/v2/app-store-submissions/', stepsCtx.global.staticContext.expoApiServerURL),\n {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${robotAccessToken}`,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n workflowJobId,\n turtleBuildId: buildId,\n // We can pass mixed object here because the configs are disjoint.\n config: {\n // AndroidSubmissionConfig\n track,\n releaseStatus,\n rollout,\n changesNotSentForReview,\n\n // IosSubmissionConfig\n appleIdUsername,\n ascAppIdentifier,\n },\n }),\n }\n );\n\n if (!response.ok) {\n const textResult = await asyncResult(response.text());\n throw new Error(\n `Unexpected response from server (${response.status}): ${textResult.value}`\n );\n }\n\n const jsonResult = await asyncResult(response.json());\n if (!jsonResult.ok) {\n stepsCtx.logger.warn(\n `Submission created. Failed to parse response. ${jsonResult.reason}`\n );\n return;\n }\n\n const data = jsonResult.value.data;\n stepsCtx.logger.info(`Submission created:\\n ID: ${data.id}\\n URL: ${data.url}`);\n } catch (e) {\n stepsCtx.logger.error(`Failed to create submission entity. ${e}`);\n }\n },\n });\n}\n"]}
@@ -2,11 +2,11 @@
2
2
  import { BuildFunction } from '@expo/steps';
3
3
  import { bunyan } from '@expo/logger';
4
4
  export declare function createDownloadBuildFunction(): BuildFunction;
5
- export declare function downloadBuildAsync({ logger, buildId, expoApiServerURL, expoToken, extensions, }: {
5
+ export declare function downloadBuildAsync({ logger, buildId, expoApiServerURL, robotAccessToken, extensions, }: {
6
6
  logger: bunyan;
7
7
  buildId: string;
8
8
  expoApiServerURL: string;
9
- expoToken: string | null;
9
+ robotAccessToken: string | null;
10
10
  extensions: string[];
11
11
  }): Promise<{
12
12
  artifactPath: string;
@@ -44,8 +44,8 @@ function createDownloadBuildFunction() {
44
44
  required: true,
45
45
  }),
46
46
  ],
47
- fn: async (stepsCtx, { inputs, outputs, env }) => {
48
- var _a;
47
+ fn: async (stepsCtx, { inputs, outputs }) => {
48
+ var _a, _b;
49
49
  const { logger } = stepsCtx;
50
50
  const extensions = zod_1.z.array(zod_1.z.string()).parse(inputs.extensions.value);
51
51
  logger.info(`Expected extensions: [${extensions.join(', ')}]`);
@@ -55,7 +55,7 @@ function createDownloadBuildFunction() {
55
55
  logger,
56
56
  buildId,
57
57
  expoApiServerURL: stepsCtx.global.staticContext.expoApiServerURL,
58
- expoToken: (_a = env.EXPO_TOKEN) !== null && _a !== void 0 ? _a : null,
58
+ robotAccessToken: (_b = (_a = stepsCtx.global.staticContext.job.secrets) === null || _a === void 0 ? void 0 : _a.robotAccessToken) !== null && _b !== void 0 ? _b : null,
59
59
  extensions,
60
60
  });
61
61
  outputs.artifact_path.set(artifactPath);
@@ -63,10 +63,10 @@ function createDownloadBuildFunction() {
63
63
  });
64
64
  }
65
65
  exports.createDownloadBuildFunction = createDownloadBuildFunction;
66
- async function downloadBuildAsync({ logger, buildId, expoApiServerURL, expoToken, extensions, }) {
66
+ async function downloadBuildAsync({ logger, buildId, expoApiServerURL, robotAccessToken, extensions, }) {
67
67
  const downloadDestinationDirectory = await node_fs_1.default.promises.mkdtemp(node_path_1.default.join(node_os_1.default.tmpdir(), 'download_build-downloaded-'));
68
68
  const response = await (0, retryOnDNSFailure_1.retryOnDNSFailure)(node_fetch_1.default)(new URL(`/v2/artifacts/eas/${buildId}`, expoApiServerURL), {
69
- headers: expoToken ? { Authorization: `Bearer ${expoToken}` } : undefined,
69
+ headers: robotAccessToken ? { Authorization: `Bearer ${robotAccessToken}` } : undefined,
70
70
  });
71
71
  if (!response.ok) {
72
72
  const textResult = await (0, results_1.asyncResult)(response.text());
@@ -1 +1 @@
1
- {"version":3,"file":"downloadBuild.js","sourceRoot":"","sources":["../../../src/steps/functions/downloadBuild.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAAyB;AACzB,sDAAyB;AACzB,oDAA4B;AAC5B,+BAAiC;AAEjC,uCAKqB;AACrB,2CAA4C;AAC5C,4DAA+B;AAC/B,yCAAiC;AACjC,6BAAwB;AAExB,4DAAkE;AAElE,qEAAkE;AAClE,qDAAoD;AACpD,6CAAyE;AACzE,iDAAgD;AAEhD,MAAM,cAAc,GAAG,IAAA,gBAAS,EAAC,gBAAM,CAAC,QAAQ,CAAC,CAAC;AAElD,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,gBAAgB;QACtB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,QAAQ,EAAE,IAAI;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,YAAY;gBAChB,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,IAAI;gBACtD,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;aAC3C,CAAC;SACH;QACD,eAAe,EAAE;YACf,uBAAe,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s from 'node:fs';\nimport os from 'node:os';\nimport stream from 'stream';\nimport { promisify } from 'util';\n\nimport {\n BuildFunction,\n BuildStepInput,\n BuildStepInputValueTypeName,\n BuildStepOutput,\n} from '@expo/steps';\nimport { asyncResult } from '@expo/results';\nimport fetch from 'node-fetch';\nimport { glob } from 'fast-glob';\nimport { z } from 'zod';\nimport { bunyan } from '@expo/logger';\nimport { UserFacingError } from '@expo/eas-build-job/dist/errors';\n\nimport { retryOnDNSFailure } from '../../utils/retryOnDNSFailure';\nimport { formatBytes } from '../../utils/artifacts';\nimport { decompressTarAsync, isFileTarGzAsync } from '../../utils/files';\nimport { pluralize } from '../../utils/strings';\n\nconst streamPipeline = promisify(stream.pipeline);\n\nexport function createDownloadBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'download_build',\n name: 'Download build',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'build_id',\n required: true,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'extensions',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.JSON,\n defaultValue: ['apk', 'aab', 'ipa', 'app'],\n }),\n ],\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'artifact_path',\n required: true,\n }),\n ],\n fn: async (stepsCtx, { inputs, outputs, env }) => {\n const { logger } = stepsCtx;\n\n const extensions = z.array(z.string()).parse(inputs.extensions.value);\n logger.info(`Expected extensions: [${extensions.join(', ')}]`);\n const buildId = z.string().uuid().parse(inputs.build_id.value);\n logger.info(`Downloading build ${buildId}...`);\n\n const { artifactPath } = await downloadBuildAsync({\n logger,\n buildId,\n expoApiServerURL: stepsCtx.global.staticContext.expoApiServerURL,\n expoToken: env.EXPO_TOKEN ?? null,\n extensions,\n });\n\n outputs.artifact_path.set(artifactPath);\n },\n });\n}\n\nexport async function downloadBuildAsync({\n logger,\n buildId,\n expoApiServerURL,\n expoToken,\n extensions,\n}: {\n logger: bunyan;\n buildId: string;\n expoApiServerURL: string;\n expoToken: string | null;\n extensions: string[];\n}): Promise<{ artifactPath: string }> {\n const downloadDestinationDirectory = await fs.promises.mkdtemp(\n path.join(os.tmpdir(), 'download_build-downloaded-')\n );\n\n const response = await retryOnDNSFailure(fetch)(\n new URL(`/v2/artifacts/eas/${buildId}`, expoApiServerURL),\n {\n headers: expoToken ? { Authorization: `Bearer ${expoToken}` } : undefined,\n }\n );\n\n if (!response.ok) {\n const textResult = await asyncResult(response.text());\n throw new Error(`Unexpected response from server (${response.status}): ${textResult.value}`);\n }\n\n // URL may contain percent-encoded characters, e.g. my%20file.apk\n // this replaces all non-alphanumeric characters (excluding dot) with underscore\n const archiveFilename = path\n .basename(new URL(response.url).pathname)\n .replace(/([^a-z0-9.-]+)/gi, '_');\n const archivePath = path.join(downloadDestinationDirectory, archiveFilename);\n\n await streamPipeline(response.body, fs.createWriteStream(archivePath));\n\n const { size } = await fs.promises.stat(archivePath);\n\n logger.info(`Downloaded ${archivePath} (${formatBytes(size)} bytes).`);\n\n const isFileATarGzArchive = await isFileTarGzAsync(archivePath);\n\n if (!isFileATarGzArchive) {\n logger.info(`Artifact is not a .tar.gz archive, skipping decompression and validation.`);\n return { artifactPath: archivePath };\n }\n\n const extractionDirectory = await fs.promises.mkdtemp(\n path.join(os.tmpdir(), 'download_build-extracted-')\n );\n await decompressTarAsync({\n archivePath,\n destinationDirectory: extractionDirectory,\n });\n\n const matchingFiles = await glob(`**/*.(${extensions.join('|')})`, {\n absolute: true,\n cwd: extractionDirectory,\n onlyFiles: false,\n onlyDirectories: false,\n });\n\n if (matchingFiles.length === 0) {\n throw new UserFacingError(\n 'EAS_DOWNLOAD_BUILD_NO_MATCHING_FILES',\n `No ${extensions.map((ext) => `.${ext}`).join(', ')} entries found in the archive.`\n );\n }\n\n logger.info(\n `Found ${matchingFiles.length} matching ${pluralize(matchingFiles.length, 'entry')}:\\n${matchingFiles.map((f) => `- ${path.relative(extractionDirectory, f)}`).join('\\n')}`\n );\n\n return { artifactPath: matchingFiles[0] };\n}\n"]}
1
+ {"version":3,"file":"downloadBuild.js","sourceRoot":"","sources":["../../../src/steps/functions/downloadBuild.ts"],"names":[],"mappings":";;;;;;AAAA,0DAA6B;AAC7B,sDAAyB;AACzB,sDAAyB;AACzB,oDAA4B;AAC5B,+BAAiC;AAEjC,uCAKqB;AACrB,2CAA4C;AAC5C,4DAA+B;AAC/B,yCAAiC;AACjC,6BAAwB;AAExB,4DAAkE;AAElE,qEAAkE;AAClE,qDAAoD;AACpD,6CAAyE;AACzE,iDAAgD;AAEhD,MAAM,cAAc,GAAG,IAAA,gBAAS,EAAC,gBAAM,CAAC,QAAQ,CAAC,CAAC;AAElD,SAAgB,2BAA2B;IACzC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,gBAAgB;QACtB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,QAAQ,EAAE,IAAI;gBACd,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,YAAY;gBAChB,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,IAAI;gBACtD,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;aAC3C,CAAC;SACH;QACD,eAAe,EAAE;YACf,uBAAe,CAAC,cAAc,CAAC;gBAC7B,EAAE,EAAE,eAAe;gBACnB,QAAQ,EAAE,IAAI;aACf,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;;YAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC;YAE5B,MAAM,UAAU,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,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BAA2B,CAAC,CACpD,CAAC;IACF,MAAM,IAAA,0BAAkB,EAAC;QACvB,WAAW;QACX,oBAAoB,EAAE,mBAAmB;KAC1C,CAAC,CAAC;IAEH,MAAM,aAAa,GAAG,MAAM,IAAA,gBAAI,EAAC,SAAS,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE;QACjE,QAAQ,EAAE,IAAI;QACd,GAAG,EAAE,mBAAmB;QACxB,SAAS,EAAE,KAAK;QAChB,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IAEH,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,wBAAe,CACvB,sCAAsC,EACtC,MAAM,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,IAAI,CACT,SAAS,aAAa,CAAC,MAAM,aAAa,IAAA,mBAAS,EAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,mBAAI,CAAC,QAAQ,CAAC,mBAAmB,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAC5K,CAAC;IAEF,OAAO,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5C,CAAC;AA5ED,gDA4EC","sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport stream from 'stream';\nimport { promisify } from 'util';\n\nimport {\n BuildFunction,\n BuildStepInput,\n BuildStepInputValueTypeName,\n BuildStepOutput,\n} from '@expo/steps';\nimport { asyncResult } from '@expo/results';\nimport fetch from 'node-fetch';\nimport { glob } from 'fast-glob';\nimport { z } from 'zod';\nimport { bunyan } from '@expo/logger';\nimport { UserFacingError } from '@expo/eas-build-job/dist/errors';\n\nimport { retryOnDNSFailure } from '../../utils/retryOnDNSFailure';\nimport { formatBytes } from '../../utils/artifacts';\nimport { decompressTarAsync, isFileTarGzAsync } from '../../utils/files';\nimport { pluralize } from '../../utils/strings';\n\nconst streamPipeline = promisify(stream.pipeline);\n\nexport function createDownloadBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'download_build',\n name: 'Download build',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'build_id',\n required: true,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'extensions',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.JSON,\n defaultValue: ['apk', 'aab', 'ipa', 'app'],\n }),\n ],\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'artifact_path',\n required: true,\n }),\n ],\n fn: async (stepsCtx, { inputs, outputs }) => {\n const { logger } = stepsCtx;\n\n const extensions = z.array(z.string()).parse(inputs.extensions.value);\n logger.info(`Expected extensions: [${extensions.join(', ')}]`);\n const buildId = z.string().uuid().parse(inputs.build_id.value);\n logger.info(`Downloading build ${buildId}...`);\n\n const { artifactPath } = await downloadBuildAsync({\n logger,\n buildId,\n expoApiServerURL: stepsCtx.global.staticContext.expoApiServerURL,\n robotAccessToken: stepsCtx.global.staticContext.job.secrets?.robotAccessToken ?? null,\n extensions,\n });\n\n outputs.artifact_path.set(artifactPath);\n },\n });\n}\n\nexport async function downloadBuildAsync({\n logger,\n buildId,\n expoApiServerURL,\n robotAccessToken,\n extensions,\n}: {\n logger: bunyan;\n buildId: string;\n expoApiServerURL: string;\n robotAccessToken: string | null;\n extensions: string[];\n}): Promise<{ artifactPath: string }> {\n const downloadDestinationDirectory = await fs.promises.mkdtemp(\n path.join(os.tmpdir(), 'download_build-downloaded-')\n );\n\n const response = await retryOnDNSFailure(fetch)(\n new URL(`/v2/artifacts/eas/${buildId}`, expoApiServerURL),\n {\n headers: robotAccessToken ? { Authorization: `Bearer ${robotAccessToken}` } : undefined,\n }\n );\n\n if (!response.ok) {\n const textResult = await asyncResult(response.text());\n throw new Error(`Unexpected response from server (${response.status}): ${textResult.value}`);\n }\n\n // URL may contain percent-encoded characters, e.g. my%20file.apk\n // this replaces all non-alphanumeric characters (excluding dot) with underscore\n const archiveFilename = path\n .basename(new URL(response.url).pathname)\n .replace(/([^a-z0-9.-]+)/gi, '_');\n const archivePath = path.join(downloadDestinationDirectory, archiveFilename);\n\n await streamPipeline(response.body, fs.createWriteStream(archivePath));\n\n const { size } = await fs.promises.stat(archivePath);\n\n logger.info(`Downloaded ${archivePath} (${formatBytes(size)} bytes).`);\n\n const isFileATarGzArchive = await isFileTarGzAsync(archivePath);\n\n if (!isFileATarGzArchive) {\n logger.info(`Artifact is not a .tar.gz archive, skipping decompression and validation.`);\n return { artifactPath: archivePath };\n }\n\n const extractionDirectory = await fs.promises.mkdtemp(\n path.join(os.tmpdir(), 'download_build-extracted-')\n );\n await decompressTarAsync({\n archivePath,\n destinationDirectory: extractionDirectory,\n });\n\n const matchingFiles = await glob(`**/*.(${extensions.join('|')})`, {\n absolute: true,\n cwd: extractionDirectory,\n onlyFiles: false,\n onlyDirectories: false,\n });\n\n if (matchingFiles.length === 0) {\n throw new UserFacingError(\n 'EAS_DOWNLOAD_BUILD_NO_MATCHING_FILES',\n `No ${extensions.map((ext) => `.${ext}`).join(', ')} entries found in the archive.`\n );\n }\n\n logger.info(\n `Found ${matchingFiles.length} matching ${pluralize(matchingFiles.length, 'entry')}:\\n${matchingFiles.map((f) => `- ${path.relative(extractionDirectory, f)}`).join('\\n')}`\n );\n\n return { artifactPath: matchingFiles[0] };\n}\n"]}
@@ -14,7 +14,8 @@ function createInstallPodsBuildFunction() {
14
14
  fn: async (stepsCtx, { env }) => {
15
15
  stepsCtx.logger.info('Installing pods');
16
16
  const verboseFlag = stepsCtx.global.env['EAS_VERBOSE'] === '1' ? ['--verbose'] : [];
17
- await (0, turtle_spawn_1.default)('pod', ['install', ...verboseFlag], {
17
+ const cocoapodsDeploymentFlag = stepsCtx.global.env['POD_INSTALL_DEPLOYMENT'] === '1' ? ['--deployment'] : [];
18
+ await (0, turtle_spawn_1.default)('pod', ['install', ...verboseFlag, ...cocoapodsDeploymentFlag], {
18
19
  logger: stepsCtx.logger,
19
20
  env: {
20
21
  ...env,
@@ -1 +1 @@
1
- {"version":3,"file":"installPods.js","sourceRoot":"","sources":["../../../src/steps/functions/installPods.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAC5C,sEAAuC;AAEvC,SAAgB,8BAA8B;IAC5C,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YAC9B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACxC,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAEpF,MAAM,IAAA,sBAAK,EAAC,KAAK,EAAE,CAAC,SAAS,EAAE,GAAG,WAAW,CAAC,EAAE;gBAC9C,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,GAAG,EAAE;oBACH,GAAG,GAAG;oBACN,IAAI,EAAE,aAAa;iBACpB;gBACD,GAAG,EAAE,QAAQ,CAAC,gBAAgB;gBAC9B,eAAe,EAAE,CAAC,IAAa,EAAE,EAAE;oBACjC,IACE,CAAC,IAAI;wBACL,2EAA2E,CAAC,IAAI,CAAC,IAAI,CAAC,EACtF,CAAC;wBACD,OAAO,IAAI,CAAC;oBACd,CAAC;yBAAM,CAAC;wBACN,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA7BD,wEA6BC","sourcesContent":["import { BuildFunction } from '@expo/steps';\nimport spawn from '@expo/turtle-spawn';\n\nexport function createInstallPodsBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_pods',\n name: 'Install Pods',\n fn: async (stepsCtx, { env }) => {\n stepsCtx.logger.info('Installing pods');\n const verboseFlag = stepsCtx.global.env['EAS_VERBOSE'] === '1' ? ['--verbose'] : [];\n\n await spawn('pod', ['install', ...verboseFlag], {\n logger: stepsCtx.logger,\n env: {\n ...env,\n LANG: 'en_US.UTF-8',\n },\n cwd: stepsCtx.workingDirectory,\n lineTransformer: (line?: string) => {\n if (\n !line ||\n /\\[!\\] '[\\w-]+' uses the unencrypted 'http' protocol to transfer the Pod\\./.exec(line)\n ) {\n return null;\n } else {\n return line;\n }\n },\n });\n },\n });\n}\n"]}
1
+ {"version":3,"file":"installPods.js","sourceRoot":"","sources":["../../../src/steps/functions/installPods.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA4C;AAC5C,sEAAuC;AAEvC,SAAgB,8BAA8B;IAC5C,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,cAAc;QAClB,IAAI,EAAE,cAAc;QACpB,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;YAC9B,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACxC,MAAM,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACpF,MAAM,uBAAuB,GAC3B,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAEhF,MAAM,IAAA,sBAAK,EAAC,KAAK,EAAE,CAAC,SAAS,EAAE,GAAG,WAAW,EAAE,GAAG,uBAAuB,CAAC,EAAE;gBAC1E,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,GAAG,EAAE;oBACH,GAAG,GAAG;oBACN,IAAI,EAAE,aAAa;iBACpB;gBACD,GAAG,EAAE,QAAQ,CAAC,gBAAgB;gBAC9B,eAAe,EAAE,CAAC,IAAa,EAAE,EAAE;oBACjC,IACE,CAAC,IAAI;wBACL,2EAA2E,CAAC,IAAI,CAAC,IAAI,CAAC,EACtF,CAAC;wBACD,OAAO,IAAI,CAAC;oBACd,CAAC;yBAAM,CAAC;wBACN,OAAO,IAAI,CAAC;oBACd,CAAC;gBACH,CAAC;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/BD,wEA+BC","sourcesContent":["import { BuildFunction } from '@expo/steps';\nimport spawn from '@expo/turtle-spawn';\n\nexport function createInstallPodsBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'install_pods',\n name: 'Install Pods',\n fn: async (stepsCtx, { env }) => {\n stepsCtx.logger.info('Installing pods');\n const verboseFlag = stepsCtx.global.env['EAS_VERBOSE'] === '1' ? ['--verbose'] : [];\n const cocoapodsDeploymentFlag =\n stepsCtx.global.env['POD_INSTALL_DEPLOYMENT'] === '1' ? ['--deployment'] : [];\n\n await spawn('pod', ['install', ...verboseFlag, ...cocoapodsDeploymentFlag], {\n logger: stepsCtx.logger,\n env: {\n ...env,\n LANG: 'en_US.UTF-8',\n },\n cwd: stepsCtx.workingDirectory,\n lineTransformer: (line?: string) => {\n if (\n !line ||\n /\\[!\\] '[\\w-]+' uses the unencrypted 'http' protocol to transfer the Pod\\./.exec(line)\n ) {\n return null;\n } else {\n return line;\n }\n },\n });\n },\n });\n}\n"]}
@@ -1,2 +1,20 @@
1
+ /// <reference types="bunyan" />
2
+ import { type Job } from '@expo/eas-build-job';
3
+ import { type bunyan } from '@expo/logger';
1
4
  import { BuildFunction } from '@expo/steps';
5
+ import { type AndroidSigningOptions, type IosSigningOptions } from '@expo/repack-app';
2
6
  export declare function createRepackBuildFunction(): BuildFunction;
7
+ /**
8
+ * Resolves Android signing options from the job secrets.
9
+ */
10
+ export declare function resolveAndroidSigningOptionsAsync({ job, tmpDir, }: {
11
+ job: Job;
12
+ tmpDir: string;
13
+ }): Promise<AndroidSigningOptions | undefined>;
14
+ /**
15
+ * Resolves iOS signing options from the job secrets.
16
+ */
17
+ export declare function resolveIosSigningOptionsAsync({ job, logger, }: {
18
+ job: Job;
19
+ logger: bunyan;
20
+ }): Promise<IosSigningOptions | undefined>;
@@ -3,137 +3,185 @@ 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.createRepackBuildFunction = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const util_1 = require("util");
9
- const stream_1 = require("stream");
10
- const os_1 = __importDefault(require("os"));
11
- const assert_1 = __importDefault(require("assert"));
12
- const steps_1 = require("@expo/steps");
13
- const fs_extra_1 = __importDefault(require("fs-extra"));
6
+ exports.resolveIosSigningOptionsAsync = exports.resolveAndroidSigningOptionsAsync = exports.createRepackBuildFunction = void 0;
7
+ const node_crypto_1 = require("node:crypto");
8
+ const node_fs_1 = __importDefault(require("node:fs"));
9
+ const node_os_1 = __importDefault(require("node:os"));
10
+ const node_path_1 = __importDefault(require("node:path"));
14
11
  const eas_build_job_1 = require("@expo/eas-build-job");
15
- const node_fetch_1 = __importDefault(require("node-fetch"));
12
+ const steps_1 = require("@expo/steps");
16
13
  const repack_app_1 = require("@expo/repack-app");
17
- const uuid_1 = require("uuid");
14
+ const fastlane_1 = require("../../common/fastlane");
18
15
  const manager_1 = __importDefault(require("../utils/ios/credentials/manager"));
19
- const pipeline = (0, util_1.promisify)(stream_1.Stream.pipeline);
20
16
  function createRepackBuildFunction() {
21
17
  return new steps_1.BuildFunction({
22
18
  namespace: 'eas',
23
- id: '__download_and_repack_golden_development_client_archive',
24
- name: 'Download and repack golden development client archive',
19
+ id: 'repack',
20
+ name: 'Repack app',
21
+ inputProviders: [
22
+ steps_1.BuildStepInput.createProvider({
23
+ id: 'source_app_path',
24
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
25
+ required: true,
26
+ }),
27
+ steps_1.BuildStepInput.createProvider({
28
+ id: 'platform',
29
+ required: false,
30
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
31
+ }),
32
+ steps_1.BuildStepInput.createProvider({
33
+ id: 'output_path',
34
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
35
+ required: false,
36
+ }),
37
+ steps_1.BuildStepInput.createProvider({
38
+ id: 'embed_bundle_assets',
39
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
40
+ required: false,
41
+ }),
42
+ ],
25
43
  outputProviders: [
26
44
  steps_1.BuildStepOutput.createProvider({
27
- id: 'repacked_archive_path',
45
+ id: 'output_path',
28
46
  required: true,
29
47
  }),
30
48
  ],
31
- fn: async (stepsCtx, { outputs, env }) => {
32
- var _a, _b, _c, _d;
33
- const tmpDir = path_1.default.join(os_1.default.tmpdir(), `eas-build-golden-dev-client-app-${(0, uuid_1.v4)()}`);
34
- await fs_extra_1.default.mkdirs(tmpDir);
35
- const workingDirectory = path_1.default.join(tmpDir, 'working-directory');
36
- await fs_extra_1.default.mkdirs(workingDirectory);
37
- stepsCtx.logger.info(`Created temporary directory: ${tmpDir}`);
38
- stepsCtx.logger.info('Downloading golden development client archive...');
39
- const fileName = stepsCtx.global.staticContext.job.platform === eas_build_job_1.Platform.IOS
40
- ? stepsCtx.global.staticContext.job.simulator
41
- ? 'golden-dev-client-simulator-latest.ipa'
42
- : 'golden-dev-client-device-latest.ipa'
43
- : 'golden-dev-client-latest.apk';
44
- const goldenArchiveUrl = (_a = env.__EAS_GOLDEN_DEV_CLIENT_URL) !== null && _a !== void 0 ? _a : `https://storage.googleapis.com/turtle-v2/onboarding/${fileName}`;
45
- const goldenArchivePath = path_1.default.join(tmpDir, fileName);
46
- try {
47
- const response = await (0, node_fetch_1.default)(goldenArchiveUrl, {
48
- timeout: 1 * 60 * 1000, // 1 minute
49
- });
50
- if (!response.ok) {
51
- throw new Error(`[${response.status}] ${response.statusText}`);
52
- }
53
- await pipeline(response.body, fs_extra_1.default.createWriteStream(goldenArchivePath));
54
- }
55
- catch (error) {
56
- throw new Error(`Failed to download golden development client archive: ${error.message}`);
49
+ fn: async (stepsCtx, { inputs, outputs, env }) => {
50
+ var _a, _b;
51
+ const projectRoot = stepsCtx.workingDirectory;
52
+ const verbose = stepsCtx.global.env['EAS_VERBOSE'] === '1';
53
+ const platform = (_a = inputs.platform.value) !== null && _a !== void 0 ? _a : stepsCtx.global.staticContext.job.platform;
54
+ if (![eas_build_job_1.Platform.ANDROID, eas_build_job_1.Platform.IOS].includes(platform)) {
55
+ throw new Error(`Unsupported platform: ${platform}. Platform must be "${eas_build_job_1.Platform.ANDROID}" or "${eas_build_job_1.Platform.IOS}"`);
57
56
  }
58
- stepsCtx.logger.info(`Downloaded golden development client archive to ${goldenArchivePath}`);
59
- stepsCtx.logger.info('Repacking and resigning the app...');
60
- const repackedArchivePath = path_1.default.join(tmpDir, stepsCtx.global.staticContext.job.platform === eas_build_job_1.Platform.IOS
61
- ? stepsCtx.global.staticContext.job.simulator
62
- ? 'target.zip'
63
- : 'target.ipa'
64
- : 'target.apk');
65
- if (stepsCtx.global.staticContext.job.platform === eas_build_job_1.Platform.IOS) {
66
- await (0, repack_app_1.repackAppIosAsync)({
67
- platform: 'ios',
68
- projectRoot: stepsCtx.workingDirectory,
69
- sourceAppPath: goldenArchivePath,
70
- outputPath: repackedArchivePath,
71
- workingDirectory,
72
- iosSigningOptions: stepsCtx.global.staticContext.job.simulator
73
- ? undefined
74
- : await resolveIosSigningOptions({
57
+ const repackSpawnAsync = createSpawnAsyncStepAdapter({ verbose, logger: stepsCtx.logger });
58
+ const tmpDir = await node_fs_1.default.promises.mkdtemp(node_path_1.default.join(node_os_1.default.tmpdir(), `repack-`));
59
+ const workingDirectory = node_path_1.default.join(tmpDir, 'working-directory');
60
+ await node_fs_1.default.promises.mkdir(workingDirectory);
61
+ stepsCtx.logger.info(`Created temporary working directory: ${workingDirectory}`);
62
+ const sourceAppPath = inputs.source_app_path.value;
63
+ const outputPath = (_b = inputs.output_path.value) !== null && _b !== void 0 ? _b : node_path_1.default.join(tmpDir, `repacked-${(0, node_crypto_1.randomUUID)()}${node_path_1.default.extname(sourceAppPath)}`);
64
+ const exportEmbedOptions = inputs.embed_bundle_assets.value
65
+ ? {
66
+ sourcemapOutput: undefined,
67
+ }
68
+ : undefined;
69
+ stepsCtx.logger.info('Repacking the app...');
70
+ switch (platform) {
71
+ case eas_build_job_1.Platform.IOS:
72
+ await (0, repack_app_1.repackAppIosAsync)({
73
+ platform: 'ios',
74
+ projectRoot,
75
+ sourceAppPath,
76
+ outputPath,
77
+ workingDirectory,
78
+ exportEmbedOptions,
79
+ iosSigningOptions: await resolveIosSigningOptionsAsync({
80
+ job: stepsCtx.global.staticContext.job,
75
81
  logger: stepsCtx.logger,
76
- buildCredentials: (_b = stepsCtx.global.staticContext.job.secrets) === null || _b === void 0 ? void 0 : _b.buildCredentials,
77
82
  }),
78
- logger: stepsCtx.logger,
79
- verbose: env.__EAS_REPACK_VERBOSE !== undefined,
80
- env: {
81
- FASTLANE_DISABLE_COLORS: '1',
82
- FASTLANE_SKIP_UPDATE_CHECK: '1',
83
- SKIP_SLOW_FASTLANE_WARNING: 'true',
84
- FASTLANE_HIDE_TIMESTAMP: 'true',
85
- LC_ALL: 'en_US.UTF-8',
86
- ...env,
87
- },
88
- });
89
- }
90
- else if (stepsCtx.global.staticContext.job.platform === eas_build_job_1.Platform.ANDROID) {
91
- let androidCredentials;
92
- if ((_d = (_c = stepsCtx.global.staticContext.job.secrets) === null || _c === void 0 ? void 0 : _c.buildCredentials) === null || _d === void 0 ? void 0 : _d.keystore.dataBase64) {
93
- const keyStorePath = path_1.default.join(tmpDir, `keystore-${(0, uuid_1.v4)()}`);
94
- await fs_extra_1.default.writeFile(keyStorePath, Buffer.from(stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.dataBase64, 'base64'));
95
- androidCredentials = {
96
- keyStorePath,
97
- keyStorePassword: `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keystorePassword}`,
98
- keyAlias: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyAlias,
99
- keyPassword: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore
100
- .keyPassword
101
- ? `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyPassword}`
102
- : undefined,
103
- };
104
- }
105
- await (0, repack_app_1.repackAppAndroidAsync)({
106
- platform: 'android',
107
- projectRoot: stepsCtx.workingDirectory,
108
- sourceAppPath: goldenArchivePath,
109
- outputPath: repackedArchivePath,
110
- workingDirectory,
111
- androidSigningOptions: androidCredentials,
112
- logger: stepsCtx.logger,
113
- verbose: env.__EAS_REPACK_VERBOSE !== undefined,
114
- env,
115
- });
116
- }
117
- else {
118
- throw new Error('Unsupported platform');
119
- }
120
- if (!(await fs_extra_1.default.exists(repackedArchivePath))) {
121
- throw new Error(`Failed to repack the app. ${repackedArchivePath} does not exist`);
83
+ logger: stepsCtx.logger,
84
+ spawnAsync: repackSpawnAsync,
85
+ verbose,
86
+ env: {
87
+ ...fastlane_1.COMMON_FASTLANE_ENV,
88
+ ...env,
89
+ },
90
+ });
91
+ break;
92
+ case eas_build_job_1.Platform.ANDROID:
93
+ {
94
+ const androidSigningOptions = await resolveAndroidSigningOptionsAsync({
95
+ job: stepsCtx.global.staticContext.job,
96
+ tmpDir,
97
+ });
98
+ try {
99
+ await (0, repack_app_1.repackAppAndroidAsync)({
100
+ platform: 'android',
101
+ projectRoot,
102
+ sourceAppPath,
103
+ outputPath,
104
+ workingDirectory,
105
+ exportEmbedOptions,
106
+ androidSigningOptions,
107
+ logger: stepsCtx.logger,
108
+ spawnAsync: repackSpawnAsync,
109
+ verbose,
110
+ env,
111
+ });
112
+ }
113
+ finally {
114
+ const keyStorePath = androidSigningOptions === null || androidSigningOptions === void 0 ? void 0 : androidSigningOptions.keyStorePath;
115
+ if (keyStorePath) {
116
+ await node_fs_1.default.promises.rm(keyStorePath, { force: true });
117
+ }
118
+ }
119
+ }
120
+ break;
122
121
  }
123
- stepsCtx.logger.info(`Repacked and resigned the app to ${repackedArchivePath}`);
124
- outputs.repacked_archive_path.set(repackedArchivePath);
122
+ stepsCtx.logger.info(`Repacked the app to ${outputPath}`);
123
+ outputs.output_path.set(outputPath);
125
124
  },
126
125
  });
127
126
  }
128
127
  exports.createRepackBuildFunction = createRepackBuildFunction;
129
- async function resolveIosSigningOptions({ buildCredentials, logger, }) {
130
- (0, assert_1.default)(buildCredentials, 'buildCredentials is required for repacking non-simulator iOS apps');
128
+ /**
129
+ * Creates `@expo/steps` based spawnAsync for repack.
130
+ */
131
+ function createSpawnAsyncStepAdapter({ verbose, logger, }) {
132
+ return function repackSpawnAsync(command, args, options) {
133
+ return (0, steps_1.spawnAsync)(command, args, {
134
+ ...options,
135
+ ...(verbose ? { logger, stdio: 'pipe' } : { logger: undefined }),
136
+ });
137
+ };
138
+ }
139
+ /**
140
+ * Resolves Android signing options from the job secrets.
141
+ */
142
+ async function resolveAndroidSigningOptionsAsync({ job, tmpDir, }) {
143
+ var _a;
144
+ const androidJob = job;
145
+ const buildCredentials = (_a = androidJob.secrets) === null || _a === void 0 ? void 0 : _a.buildCredentials;
146
+ if ((buildCredentials === null || buildCredentials === void 0 ? void 0 : buildCredentials.keystore.dataBase64) == null) {
147
+ return undefined;
148
+ }
149
+ const keyStorePath = node_path_1.default.join(tmpDir, `keystore-${(0, node_crypto_1.randomUUID)()}`);
150
+ await node_fs_1.default.promises.writeFile(keyStorePath, Buffer.from(buildCredentials.keystore.dataBase64, 'base64'));
151
+ const keyStorePassword = `pass:${buildCredentials.keystore.keystorePassword}`;
152
+ const keyAlias = buildCredentials.keystore.keyAlias;
153
+ const keyPassword = buildCredentials.keystore.keyPassword
154
+ ? `pass:${buildCredentials.keystore.keyPassword}`
155
+ : undefined;
156
+ return {
157
+ keyStorePath,
158
+ keyStorePassword,
159
+ keyAlias,
160
+ keyPassword,
161
+ };
162
+ }
163
+ exports.resolveAndroidSigningOptionsAsync = resolveAndroidSigningOptionsAsync;
164
+ /**
165
+ * Resolves iOS signing options from the job secrets.
166
+ */
167
+ async function resolveIosSigningOptionsAsync({ job, logger, }) {
168
+ var _a;
169
+ const iosJob = job;
170
+ const buildCredentials = (_a = iosJob.secrets) === null || _a === void 0 ? void 0 : _a.buildCredentials;
171
+ if (iosJob.simulator || buildCredentials == null) {
172
+ return undefined;
173
+ }
131
174
  const credentialsManager = new manager_1.default(buildCredentials);
132
175
  const credentials = await credentialsManager.prepare(logger);
176
+ const provisioningProfile = {};
177
+ for (const profile of Object.values(credentials.targetProvisioningProfiles)) {
178
+ provisioningProfile[profile.bundleIdentifier] = profile.path;
179
+ }
133
180
  return {
134
- provisioningProfile: Object.values(credentials.targetProvisioningProfiles)[0].path,
181
+ provisioningProfile,
135
182
  keychainPath: credentials.keychainPath,
136
183
  signingIdentity: credentials.applicationTargetProvisioningProfile.data.certificateCommonName,
137
184
  };
138
185
  }
186
+ exports.resolveIosSigningOptionsAsync = resolveIosSigningOptionsAsync;
139
187
  //# sourceMappingURL=repack.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"repack.js","sourceRoot":"","sources":["../../../src/steps/functions/repack.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AACxB,+BAAiC;AACjC,mCAAgC;AAChC,4CAAoB;AACpB,oDAA4B;AAE5B,uCAA6D;AAC7D,wDAA0B;AAC1B,uDAA+C;AAC/C,4DAA+B;AAC/B,iD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C,6BAA6B,mBAAmB,iBAAiB,CAAC,CAAC;YACrF,CAAC;YAED,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,oCAAoC,mBAAmB,EAAE,CAAC,CAAC;YAChF,OAAO,CAAC,qBAAqB,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;QACzD,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA/HD,8DA+HC;AAED,KAAK,UAAU,wBAAwB,CAAC,EACtC,gBAAgB,EAChB,MAAM,GAIP;IAKC,IAAA,gBAAM,EAAC,gBAAgB,EAAE,mEAAmE,CAAC,CAAC;IAE9F,MAAM,kBAAkB,GAAG,IAAI,iBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACvE,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7D,OAAO;QACL,mBAAmB,EAAE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;QAClF,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,eAAe,EAAE,WAAW,CAAC,oCAAoC,CAAC,IAAI,CAAC,qBAAqB;KAC7F,CAAC;AACJ,CAAC","sourcesContent":["import path from 'path';\nimport { promisify } from 'util';\nimport { Stream } from 'stream';\nimport os from 'os';\nimport assert from 'assert';\n\nimport { BuildFunction, BuildStepOutput } from '@expo/steps';\nimport fs from 'fs-extra';\nimport { Platform } from '@expo/eas-build-job';\nimport fetch from 'node-fetch';\nimport { repackAppAndroidAsync, repackAppIosAsync } from '@expo/repack-app';\nimport { v4 as uuidv4 } from 'uuid';\nimport { BuildCredentials } from '@expo/eas-build-job/dist/ios';\nimport { bunyan } from '@expo/logger';\n\nimport IosCredentialsManager from '../utils/ios/credentials/manager';\n\nconst pipeline = promisify(Stream.pipeline);\n\nexport function createRepackBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: '__download_and_repack_golden_development_client_archive',\n name: 'Download and repack golden development client archive',\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'repacked_archive_path',\n required: true,\n }),\n ],\n fn: async (stepsCtx, { outputs, env }) => {\n const tmpDir = path.join(os.tmpdir(), `eas-build-golden-dev-client-app-${uuidv4()}`);\n await fs.mkdirs(tmpDir);\n const workingDirectory = path.join(tmpDir, 'working-directory');\n await fs.mkdirs(workingDirectory);\n stepsCtx.logger.info(`Created temporary directory: ${tmpDir}`);\n\n stepsCtx.logger.info('Downloading golden development client archive...');\n const fileName =\n stepsCtx.global.staticContext.job.platform === Platform.IOS\n ? stepsCtx.global.staticContext.job.simulator\n ? 'golden-dev-client-simulator-latest.ipa'\n : 'golden-dev-client-device-latest.ipa'\n : 'golden-dev-client-latest.apk';\n const goldenArchiveUrl =\n env.__EAS_GOLDEN_DEV_CLIENT_URL ??\n `https://storage.googleapis.com/turtle-v2/onboarding/${fileName}`;\n const goldenArchivePath = path.join(tmpDir, fileName);\n try {\n const response = await fetch(goldenArchiveUrl, {\n timeout: 1 * 60 * 1000, // 1 minute\n });\n if (!response.ok) {\n throw new Error(`[${response.status}] ${response.statusText}`);\n }\n await pipeline(response.body, fs.createWriteStream(goldenArchivePath));\n } catch (error: any) {\n throw new Error(`Failed to download golden development client archive: ${error.message}`);\n }\n stepsCtx.logger.info(`Downloaded golden development client archive to ${goldenArchivePath}`);\n\n stepsCtx.logger.info('Repacking and resigning the app...');\n const repackedArchivePath = path.join(\n tmpDir,\n stepsCtx.global.staticContext.job.platform === Platform.IOS\n ? stepsCtx.global.staticContext.job.simulator\n ? 'target.zip'\n : 'target.ipa'\n : 'target.apk'\n );\n if (stepsCtx.global.staticContext.job.platform === Platform.IOS) {\n await repackAppIosAsync({\n platform: 'ios',\n projectRoot: stepsCtx.workingDirectory,\n sourceAppPath: goldenArchivePath,\n outputPath: repackedArchivePath,\n workingDirectory,\n iosSigningOptions: stepsCtx.global.staticContext.job.simulator\n ? undefined\n : await resolveIosSigningOptions({\n logger: stepsCtx.logger,\n buildCredentials: stepsCtx.global.staticContext.job.secrets?.buildCredentials,\n }),\n logger: stepsCtx.logger,\n verbose: env.__EAS_REPACK_VERBOSE !== undefined,\n env: {\n FASTLANE_DISABLE_COLORS: '1',\n FASTLANE_SKIP_UPDATE_CHECK: '1',\n SKIP_SLOW_FASTLANE_WARNING: 'true',\n FASTLANE_HIDE_TIMESTAMP: 'true',\n LC_ALL: 'en_US.UTF-8',\n ...env,\n },\n });\n } else if (stepsCtx.global.staticContext.job.platform === Platform.ANDROID) {\n let androidCredentials:\n | {\n keyStorePath: string;\n keyStorePassword: string;\n keyAlias: string;\n keyPassword: string | undefined;\n }\n | undefined;\n if (stepsCtx.global.staticContext.job.secrets?.buildCredentials?.keystore.dataBase64) {\n const keyStorePath = path.join(tmpDir, `keystore-${uuidv4()}`);\n await fs.writeFile(\n keyStorePath,\n Buffer.from(\n stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.dataBase64,\n 'base64'\n )\n );\n androidCredentials = {\n keyStorePath,\n keyStorePassword: `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keystorePassword}`,\n keyAlias: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyAlias,\n keyPassword: stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore\n .keyPassword\n ? `pass:${stepsCtx.global.staticContext.job.secrets.buildCredentials.keystore.keyPassword}`\n : undefined,\n };\n }\n\n await repackAppAndroidAsync({\n platform: 'android',\n projectRoot: stepsCtx.workingDirectory,\n sourceAppPath: goldenArchivePath,\n outputPath: repackedArchivePath,\n workingDirectory,\n androidSigningOptions: androidCredentials,\n logger: stepsCtx.logger,\n verbose: env.__EAS_REPACK_VERBOSE !== undefined,\n env,\n });\n } else {\n throw new Error('Unsupported platform');\n }\n\n if (!(await fs.exists(repackedArchivePath))) {\n throw new Error(`Failed to repack the app. ${repackedArchivePath} does not exist`);\n }\n\n stepsCtx.logger.info(`Repacked and resigned the app to ${repackedArchivePath}`);\n outputs.repacked_archive_path.set(repackedArchivePath);\n },\n });\n}\n\nasync function resolveIosSigningOptions({\n buildCredentials,\n logger,\n}: {\n buildCredentials: BuildCredentials | undefined;\n logger: bunyan;\n}): Promise<{\n provisioningProfile: string;\n keychainPath: string;\n signingIdentity: string;\n}> {\n assert(buildCredentials, 'buildCredentials is required for repacking non-simulator iOS apps');\n\n const credentialsManager = new IosCredentialsManager(buildCredentials);\n const credentials = await credentialsManager.prepare(logger);\n\n return {\n provisioningProfile: Object.values(credentials.targetProvisioningProfiles)[0].path,\n keychainPath: credentials.keychainPath,\n signingIdentity: credentials.applicationTargetProvisioningProfile.data.certificateCommonName,\n };\n}\n"]}
1
+ {"version":3,"file":"repack.js","sourceRoot":"","sources":["../../../src/steps/functions/repack.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAyC;AACzC,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B,uDAAiF;AAEjF,uCAMqB;AACrB,iDAS0B;AAE1B,oDAA4D;AAC5D,+EAAqE;AAErE,SAAgB,yBAAyB;IACvC,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,QAAQ;QACZ,IAAI,EAAE,YAAY;QAClB,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,iBAAiB;gBACrB,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,IAAI;aACf,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,UAAU;gBACd,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,aAAa;gBACjB,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;gBACxD,QAAQ,EAAE,KAAK;aAChB,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,qBAA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D,MAAM,kBAAkB,GAAG,IAAI,iBAAqB,CAAC,gBAAgB,CAAC,CAAC;IACvE,MAAM,WAAW,GAAG,MAAM,kBAAkB,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7D,MAAM,mBAAmB,GAA2B,EAAE,CAAC;IACvD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,EAAE,CAAC;QAC5E,mBAAmB,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/D,CAAC;IACD,OAAO;QACL,mBAAmB;QACnB,YAAY,EAAE,WAAW,CAAC,YAAY;QACtC,eAAe,EAAE,WAAW,CAAC,oCAAoC,CAAC,IAAI,CAAC,qBAAqB;KAC7F,CAAC;AACJ,CAAC;AAxBD,sEAwBC","sourcesContent":["import { randomUUID } from 'node:crypto';\nimport fs from 'node:fs';\nimport os from 'node:os';\nimport path from 'node:path';\n\nimport { Platform, type Android, type Ios, type Job } from '@expo/eas-build-job';\nimport { type bunyan } from '@expo/logger';\nimport {\n BuildFunction,\n BuildStepInput,\n BuildStepInputValueTypeName,\n BuildStepOutput,\n spawnAsync,\n} from '@expo/steps';\nimport {\n repackAppAndroidAsync,\n repackAppIosAsync,\n type AndroidSigningOptions,\n type IosSigningOptions,\n type SpawnProcessAsync,\n type SpawnProcessOptions,\n type SpawnProcessPromise,\n type SpawnProcessResult,\n} from '@expo/repack-app';\n\nimport { COMMON_FASTLANE_ENV } from '../../common/fastlane';\nimport IosCredentialsManager from '../utils/ios/credentials/manager';\n\nexport function createRepackBuildFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'repack',\n name: 'Repack app',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'source_app_path',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: true,\n }),\n BuildStepInput.createProvider({\n id: 'platform',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'output_path',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n BuildStepInput.createProvider({\n id: 'embed_bundle_assets',\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n required: false,\n }),\n ],\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'output_path',\n required: true,\n }),\n ],\n fn: async (stepsCtx, { inputs, outputs, env }) => {\n const projectRoot = stepsCtx.workingDirectory;\n const verbose = stepsCtx.global.env['EAS_VERBOSE'] === '1';\n\n const platform =\n (inputs.platform.value as Platform) ?? stepsCtx.global.staticContext.job.platform;\n if (![Platform.ANDROID, Platform.IOS].includes(platform)) {\n throw new Error(\n `Unsupported platform: ${platform}. Platform must be \"${Platform.ANDROID}\" or \"${Platform.IOS}\"`\n );\n }\n\n const repackSpawnAsync = createSpawnAsyncStepAdapter({ verbose, logger: stepsCtx.logger });\n\n const tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), `repack-`));\n const workingDirectory = path.join(tmpDir, 'working-directory');\n await fs.promises.mkdir(workingDirectory);\n stepsCtx.logger.info(`Created temporary working directory: ${workingDirectory}`);\n\n const sourceAppPath = inputs.source_app_path.value as string;\n const outputPath =\n (inputs.output_path.value as string) ??\n path.join(tmpDir, `repacked-${randomUUID()}${path.extname(sourceAppPath)}`);\n const exportEmbedOptions = inputs.embed_bundle_assets.value\n ? {\n sourcemapOutput: undefined,\n }\n : undefined;\n\n stepsCtx.logger.info('Repacking the app...');\n switch (platform) {\n case Platform.IOS:\n await repackAppIosAsync({\n platform: 'ios',\n projectRoot,\n sourceAppPath,\n outputPath,\n workingDirectory,\n exportEmbedOptions,\n iosSigningOptions: await resolveIosSigningOptionsAsync({\n job: stepsCtx.global.staticContext.job,\n logger: stepsCtx.logger,\n }),\n logger: stepsCtx.logger,\n spawnAsync: repackSpawnAsync,\n verbose,\n env: {\n ...COMMON_FASTLANE_ENV,\n ...env,\n },\n });\n break;\n case Platform.ANDROID:\n {\n const androidSigningOptions = await resolveAndroidSigningOptionsAsync({\n job: stepsCtx.global.staticContext.job,\n tmpDir,\n });\n\n try {\n await repackAppAndroidAsync({\n platform: 'android',\n projectRoot,\n sourceAppPath,\n outputPath,\n workingDirectory,\n exportEmbedOptions,\n androidSigningOptions,\n logger: stepsCtx.logger,\n spawnAsync: repackSpawnAsync,\n verbose,\n env,\n });\n } finally {\n const keyStorePath = androidSigningOptions?.keyStorePath;\n if (keyStorePath) {\n await fs.promises.rm(keyStorePath, { force: true });\n }\n }\n }\n break;\n }\n\n stepsCtx.logger.info(`Repacked the app to ${outputPath}`);\n outputs.output_path.set(outputPath);\n },\n });\n}\n\n/**\n * Creates `@expo/steps` based spawnAsync for repack.\n */\nfunction createSpawnAsyncStepAdapter({\n verbose,\n logger,\n}: {\n verbose: boolean;\n logger: bunyan;\n}): SpawnProcessAsync {\n return function repackSpawnAsync(\n command: string,\n args: string[],\n options?: SpawnProcessOptions\n ): SpawnProcessPromise<SpawnProcessResult> {\n return spawnAsync(command, args, {\n ...options,\n ...(verbose ? { logger, stdio: 'pipe' } : { logger: undefined }),\n });\n };\n}\n\n/**\n * Resolves Android signing options from the job secrets.\n */\nexport async function resolveAndroidSigningOptionsAsync({\n job,\n tmpDir,\n}: {\n job: Job;\n tmpDir: string;\n}): Promise<AndroidSigningOptions | undefined> {\n const androidJob = job as Android.Job;\n const buildCredentials = androidJob.secrets?.buildCredentials;\n if (buildCredentials?.keystore.dataBase64 == null) {\n return undefined;\n }\n const keyStorePath = path.join(tmpDir, `keystore-${randomUUID()}`);\n await fs.promises.writeFile(\n keyStorePath,\n Buffer.from(buildCredentials.keystore.dataBase64, 'base64')\n );\n\n const keyStorePassword = `pass:${buildCredentials.keystore.keystorePassword}`;\n const keyAlias = buildCredentials.keystore.keyAlias;\n const keyPassword = buildCredentials.keystore.keyPassword\n ? `pass:${buildCredentials.keystore.keyPassword}`\n : undefined;\n return {\n keyStorePath,\n keyStorePassword,\n keyAlias,\n keyPassword,\n };\n}\n\n/**\n * Resolves iOS signing options from the job secrets.\n */\nexport async function resolveIosSigningOptionsAsync({\n job,\n logger,\n}: {\n job: Job;\n logger: bunyan;\n}): Promise<IosSigningOptions | undefined> {\n const iosJob = job as Ios.Job;\n const buildCredentials = iosJob.secrets?.buildCredentials;\n if (iosJob.simulator || buildCredentials == null) {\n return undefined;\n }\n const credentialsManager = new IosCredentialsManager(buildCredentials);\n const credentials = await credentialsManager.prepare(logger);\n\n const provisioningProfile: Record<string, string> = {};\n for (const profile of Object.values(credentials.targetProvisioningProfiles)) {\n provisioningProfile[profile.bundleIdentifier] = profile.path;\n }\n return {\n provisioningProfile,\n keychainPath: credentials.keychainPath,\n signingIdentity: credentials.applicationTargetProvisioningProfile.data.certificateCommonName,\n };\n}\n"]}
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.runFastlane = exports.runFastlaneGym = void 0;
7
7
  const path_1 = __importDefault(require("path"));
8
8
  const turtle_spawn_1 = __importDefault(require("@expo/turtle-spawn"));
9
+ const fastlane_1 = require("../../../common/fastlane");
9
10
  const xcpretty_1 = require("./xcpretty");
10
11
  async function runFastlaneGym({ workingDir, logger, buildLogsDirectory, env, extraEnv, }) {
11
12
  const buildLogger = new xcpretty_1.XcodeBuildLogger(logger, workingDir);
@@ -24,17 +25,12 @@ async function runFastlaneGym({ workingDir, logger, buildLogsDirectory, env, ext
24
25
  }
25
26
  exports.runFastlaneGym = runFastlaneGym;
26
27
  async function runFastlane(fastlaneArgs, { logger, env, cwd, extraEnv, } = {}) {
27
- const fastlaneEnvVars = {
28
- FASTLANE_DISABLE_COLORS: '1',
29
- FASTLANE_SKIP_UPDATE_CHECK: '1',
30
- SKIP_SLOW_FASTLANE_WARNING: 'true',
31
- FASTLANE_HIDE_TIMESTAMP: 'true',
32
- LC_ALL: 'en_US.UTF-8',
33
- ...(env !== null && env !== void 0 ? env : process.env),
34
- ...extraEnv,
35
- };
36
28
  return await (0, turtle_spawn_1.default)('fastlane', fastlaneArgs, {
37
- env: fastlaneEnvVars,
29
+ env: {
30
+ ...fastlane_1.COMMON_FASTLANE_ENV,
31
+ ...(env !== null && env !== void 0 ? env : process.env),
32
+ ...extraEnv,
33
+ },
38
34
  logger,
39
35
  cwd,
40
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"fastlane.js","sourceRoot":"","sources":["../../../../src/steps/utils/ios/fastlane.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,sEAAwD;AAGxD,yCAA8C;AAEvC,KAAK,UAAU,cAAc,CAAC,EACnC,UAAU,EACV,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,QAAQ,GAOT;IACC,MAAM,WAAW,GAAG,IAAI,2BAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7D,KAAK,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,MAAM,WAAW,CAAC,CAAC,KAAK,CAAC,EAAE;YACzB,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;YACjC,MAAM;YACN,GAAG;YACH,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAzBD,wCAyBC;AAEM,KAAK,UAAU,WAAW,CAC/B,YAAsB,EACtB,EACE,MAAM,EACN,GAAG,EACH,GAAG,EACH,QAAQ,MAMN,EAAE;IAEN,MAAM,eAAe,GAAG;QACtB,uBAAuB,EAAE,GAAG;QAC5B,0BAA0B,EAAE,GAAG;QAC/B,0BAA0B,EAAE,MAAM;QAClC,uBAAuB,EAAE,MAAM;QAC/B,MAAM,EAAE,aAAa;QACrB,GAAG,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,OAAO,CAAC,GAAG,CAAC;QACvB,GAAG,QAAQ;KACZ,CAAC;IACF,OAAO,MAAM,IAAA,sBAAK,EAAC,UAAU,EAAE,YAAY,EAAE;QAC3C,GAAG,EAAE,eAAe;QACpB,MAAM;QACN,GAAG;KACJ,CAAC,CAAC;AACL,CAAC;AA5BD,kCA4BC","sourcesContent":["import path from 'path';\n\nimport { bunyan } from '@expo/logger';\nimport spawn, { SpawnResult } from '@expo/turtle-spawn';\nimport { BuildStepEnv } from '@expo/steps';\n\nimport { XcodeBuildLogger } from './xcpretty';\n\nexport async function runFastlaneGym({\n workingDir,\n logger,\n buildLogsDirectory,\n env,\n extraEnv,\n}: {\n workingDir: string;\n logger: bunyan;\n buildLogsDirectory: string;\n env: BuildStepEnv;\n extraEnv?: BuildStepEnv;\n}): Promise<void> {\n const buildLogger = new XcodeBuildLogger(logger, workingDir);\n void buildLogger.watchLogFiles(buildLogsDirectory);\n try {\n await runFastlane(['gym'], {\n cwd: path.join(workingDir, 'ios'),\n logger,\n env,\n extraEnv,\n });\n } finally {\n await buildLogger.flush();\n }\n}\n\nexport async function runFastlane(\n fastlaneArgs: string[],\n {\n logger,\n env,\n cwd,\n extraEnv,\n }: {\n logger?: bunyan;\n env?: BuildStepEnv;\n cwd?: string;\n extraEnv?: BuildStepEnv;\n } = {}\n): Promise<SpawnResult> {\n const fastlaneEnvVars = {\n FASTLANE_DISABLE_COLORS: '1',\n FASTLANE_SKIP_UPDATE_CHECK: '1',\n SKIP_SLOW_FASTLANE_WARNING: 'true',\n FASTLANE_HIDE_TIMESTAMP: 'true',\n LC_ALL: 'en_US.UTF-8',\n ...(env ?? process.env),\n ...extraEnv,\n };\n return await spawn('fastlane', fastlaneArgs, {\n env: fastlaneEnvVars,\n logger,\n cwd,\n });\n}\n"]}
1
+ {"version":3,"file":"fastlane.js","sourceRoot":"","sources":["../../../../src/steps/utils/ios/fastlane.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAGxB,sEAAwD;AAGxD,uDAA+D;AAE/D,yCAA8C;AAEvC,KAAK,UAAU,cAAc,CAAC,EACnC,UAAU,EACV,MAAM,EACN,kBAAkB,EAClB,GAAG,EACH,QAAQ,GAOT;IACC,MAAM,WAAW,GAAG,IAAI,2BAAgB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC7D,KAAK,WAAW,CAAC,aAAa,CAAC,kBAAkB,CAAC,CAAC;IACnD,IAAI,CAAC;QACH,MAAM,WAAW,CAAC,CAAC,KAAK,CAAC,EAAE;YACzB,GAAG,EAAE,cAAI,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,CAAC;YACjC,MAAM;YACN,GAAG;YACH,QAAQ;SACT,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,MAAM,WAAW,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC;AAzBD,wCAyBC;AAEM,KAAK,UAAU,WAAW,CAC/B,YAAsB,EACtB,EACE,MAAM,EACN,GAAG,EACH,GAAG,EACH,QAAQ,MAMN,EAAE;IAEN,OAAO,MAAM,IAAA,sBAAK,EAAC,UAAU,EAAE,YAAY,EAAE;QAC3C,GAAG,EAAE;YACH,GAAG,8BAAmB;YACtB,GAAG,CAAC,GAAG,aAAH,GAAG,cAAH,GAAG,GAAI,OAAO,CAAC,GAAG,CAAC;YACvB,GAAG,QAAQ;SACZ;QACD,MAAM;QACN,GAAG;KACJ,CAAC,CAAC;AACL,CAAC;AAvBD,kCAuBC","sourcesContent":["import path from 'path';\n\nimport { bunyan } from '@expo/logger';\nimport spawn, { SpawnResult } from '@expo/turtle-spawn';\nimport { BuildStepEnv } from '@expo/steps';\n\nimport { COMMON_FASTLANE_ENV } from '../../../common/fastlane';\n\nimport { XcodeBuildLogger } from './xcpretty';\n\nexport async function runFastlaneGym({\n workingDir,\n logger,\n buildLogsDirectory,\n env,\n extraEnv,\n}: {\n workingDir: string;\n logger: bunyan;\n buildLogsDirectory: string;\n env: BuildStepEnv;\n extraEnv?: BuildStepEnv;\n}): Promise<void> {\n const buildLogger = new XcodeBuildLogger(logger, workingDir);\n void buildLogger.watchLogFiles(buildLogsDirectory);\n try {\n await runFastlane(['gym'], {\n cwd: path.join(workingDir, 'ios'),\n logger,\n env,\n extraEnv,\n });\n } finally {\n await buildLogger.flush();\n }\n}\n\nexport async function runFastlane(\n fastlaneArgs: string[],\n {\n logger,\n env,\n cwd,\n extraEnv,\n }: {\n logger?: bunyan;\n env?: BuildStepEnv;\n cwd?: string;\n extraEnv?: BuildStepEnv;\n } = {}\n): Promise<SpawnResult> {\n return await spawn('fastlane', fastlaneArgs, {\n env: {\n ...COMMON_FASTLANE_ENV,\n ...(env ?? process.env),\n ...extraEnv,\n },\n logger,\n cwd,\n });\n}\n"]}
@@ -18,6 +18,7 @@ async function uploadJobOutputsToWwwAsync(ctx, { logger, expoApiV2BaseUrl }) {
18
18
  const robotAccessToken = (0, nullthrows_1.default)((_a = ctx.staticContext.job.secrets) === null || _a === void 0 ? void 0 : _a.robotAccessToken);
19
19
  const interpolationContext = {
20
20
  ...ctx.staticContext,
21
+ env: ctx.env,
21
22
  always: () => true,
22
23
  never: () => false,
23
24
  success: () => !ctx.hasAnyPreviousStepFailed,