@expo/build-tools 1.0.239 → 1.0.240
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/utils/outputs.js +1 -14
- package/dist/utils/outputs.js.map +1 -1
- package/package.json +4 -4
package/dist/utils/outputs.js
CHANGED
|
@@ -17,20 +17,7 @@ async function uploadJobOutputsToWwwAsync(ctx, { logger, expoApiV2BaseUrl }) {
|
|
|
17
17
|
try {
|
|
18
18
|
const workflowJobId = (0, nullthrows_1.default)(ctx.env.__WORKFLOW_JOB_ID);
|
|
19
19
|
const robotAccessToken = (0, nullthrows_1.default)((_a = ctx.staticContext.job.secrets) === null || _a === void 0 ? void 0 : _a.robotAccessToken);
|
|
20
|
-
const interpolationContext =
|
|
21
|
-
...ctx.staticContext,
|
|
22
|
-
env: ctx.env,
|
|
23
|
-
always: () => true,
|
|
24
|
-
never: () => false,
|
|
25
|
-
success: () => !ctx.hasAnyPreviousStepFailed,
|
|
26
|
-
failure: () => ctx.hasAnyPreviousStepFailed,
|
|
27
|
-
fromJSON: (json) => JSON.parse(json),
|
|
28
|
-
toJSON: (value) => JSON.stringify(value),
|
|
29
|
-
contains: (value, substring) => value.includes(substring),
|
|
30
|
-
startsWith: (value, prefix) => value.startsWith(prefix),
|
|
31
|
-
endsWith: (value, suffix) => value.endsWith(suffix),
|
|
32
|
-
hashFiles: (...patterns) => ctx.hashFiles(...patterns),
|
|
33
|
-
};
|
|
20
|
+
const interpolationContext = ctx.getInterpolationContext();
|
|
34
21
|
logger.debug({ dynamicValues: interpolationContext }, 'Using dynamic values');
|
|
35
22
|
const outputs = collectJobOutputs({
|
|
36
23
|
jobOutputDefinitions: ctx.staticContext.job.outputs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/utils/outputs.ts"],"names":[],"mappings":";;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"outputs.js","sourceRoot":"","sources":["../../src/ut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AAK,CAAC,EAAE,GAAG,EAAE,EAAE,0BAA0B,CAAC,CAAC;QAClD,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,kEAAkE;AAClE,SAAgB,iBAAiB,CAAC,EAChC,oBAAoB,EACpB,oBAAoB,GAIrB;IACC,MAAM,UAAU,GAAuC,EAAE,CAAC;IAC1D,KAAK,MAAM,CAAC,SAAS,EAAE,gBAAgB,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACjF,MAAM,WAAW,GAAG,gBAAgB,CAAC,OAAO,CAAC,kBAAkB,EAAE,CAAC,MAAM,EAAE,UAAU,EAAE,EAAE;;YACtF,OAAO,GAAG,MAAA,IAAA,gBAAQ,EAAC,UAAU,EAAE,oBAAoB,CAAC,mCAAI,EAAE,EAAE,CAAC;QAC/D,CAAC,CAAC,CAAC;QAEH,UAAU,CAAC,SAAS,CAAC,GAAG,WAAW,CAAC;IACtC,CAAC;IAED,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import { JobInterpolationContext } from '@expo/eas-build-job';\nimport { BuildStepGlobalContext, jsepEval } from '@expo/steps';\nimport { bunyan } from '@expo/logger';\nimport nullthrows from 'nullthrows';\n\nimport { turtleFetch } from './turtleFetch';\n\nexport async function uploadJobOutputsToWwwAsync(\n ctx: BuildStepGlobalContext,\n { logger, expoApiV2BaseUrl }: { logger: bunyan; expoApiV2BaseUrl: string }\n): Promise<void> {\n if (!ctx.staticContext.job.outputs) {\n logger.info('Job defines no outputs, skipping upload');\n return;\n }\n\n try {\n const workflowJobId = nullthrows(ctx.env.__WORKFLOW_JOB_ID);\n const robotAccessToken = nullthrows(ctx.staticContext.job.secrets?.robotAccessToken);\n\n const interpolationContext = ctx.getInterpolationContext();\n logger.debug({ dynamicValues: interpolationContext }, 'Using dynamic values');\n\n const outputs = collectJobOutputs({\n jobOutputDefinitions: ctx.staticContext.job.outputs,\n interpolationContext,\n });\n logger.info('Uploading outputs');\n\n await turtleFetch(new URL(`workflows/${workflowJobId}`, expoApiV2BaseUrl).toString(), 'PATCH', {\n json: { outputs },\n headers: {\n Authorization: `Bearer ${robotAccessToken}`,\n },\n timeout: 20000,\n logger,\n });\n } catch (err) {\n logger.error({ err }, 'Failed to upload outputs');\n throw err;\n }\n}\n\n/** Function we use to get outputs of the whole job from steps. */\nexport function collectJobOutputs({\n jobOutputDefinitions,\n interpolationContext,\n}: {\n jobOutputDefinitions: Record<string, string>;\n interpolationContext: JobInterpolationContext;\n}): Record<string, string | undefined> {\n const jobOutputs: Record<string, string | undefined> = {};\n for (const [outputKey, outputDefinition] of Object.entries(jobOutputDefinitions)) {\n const outputValue = outputDefinition.replace(/\\$\\{\\{(.+?)\\}\\}/g, (_match, expression) => {\n return `${jsepEval(expression, interpolationContext) ?? ''}`;\n });\n\n jobOutputs[outputKey] = outputValue;\n }\n\n return jobOutputs;\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.240",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"@expo/config": "10.0.6",
|
|
32
32
|
"@expo/config-plugins": "9.0.12",
|
|
33
33
|
"@expo/downloader": "1.0.221",
|
|
34
|
-
"@expo/eas-build-job": "1.0.
|
|
34
|
+
"@expo/eas-build-job": "1.0.240",
|
|
35
35
|
"@expo/env": "^0.4.0",
|
|
36
36
|
"@expo/logger": "1.0.221",
|
|
37
37
|
"@expo/package-manager": "1.7.0",
|
|
38
38
|
"@expo/plist": "^0.2.0",
|
|
39
39
|
"@expo/results": "^1.0.0",
|
|
40
|
-
"@expo/steps": "1.0.
|
|
40
|
+
"@expo/steps": "1.0.240",
|
|
41
41
|
"@expo/template-file": "1.0.221",
|
|
42
42
|
"@expo/turtle-spawn": "1.0.221",
|
|
43
43
|
"@expo/xcpretty": "^4.3.1",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"node": "20.14.0",
|
|
86
86
|
"yarn": "1.22.21"
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "ce21bbbbe778ee0f7d45344facef45fd264d4292"
|
|
89
89
|
}
|