@expo/build-tools 1.0.85 → 1.0.87

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.
Files changed (42) hide show
  1. package/dist/android/gradle.d.ts +3 -2
  2. package/dist/android/gradle.js +3 -3
  3. package/dist/android/gradle.js.map +1 -1
  4. package/dist/builders/android.js +14 -1
  5. package/dist/builders/android.js.map +1 -1
  6. package/dist/builders/custom.js +16 -1
  7. package/dist/builders/custom.js.map +1 -1
  8. package/dist/builders/ios.js +14 -1
  9. package/dist/builders/ios.js.map +1 -1
  10. package/dist/common/setup.js +4 -4
  11. package/dist/common/setup.js.map +1 -1
  12. package/dist/ios/fastlane.d.ts +3 -2
  13. package/dist/ios/fastlane.js +2 -2
  14. package/dist/ios/fastlane.js.map +1 -1
  15. package/dist/steps/easFunctions.js +2 -0
  16. package/dist/steps/easFunctions.js.map +1 -1
  17. package/dist/steps/functionGroups/build.js +49 -8
  18. package/dist/steps/functionGroups/build.js.map +1 -1
  19. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.d.ts +2 -0
  20. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js +46 -0
  21. package/dist/steps/functions/calculateEASUpdateRuntimeVersion.js.map +1 -0
  22. package/dist/steps/functions/configureEASUpdateIfInstalled.js +8 -1
  23. package/dist/steps/functions/configureEASUpdateIfInstalled.js.map +1 -1
  24. package/dist/steps/functions/findAndUploadBuildArtifacts.js +86 -59
  25. package/dist/steps/functions/findAndUploadBuildArtifacts.js.map +1 -1
  26. package/dist/steps/functions/runFastlane.js +13 -6
  27. package/dist/steps/functions/runFastlane.js.map +1 -1
  28. package/dist/steps/functions/runGradle.js +9 -0
  29. package/dist/steps/functions/runGradle.js.map +1 -1
  30. package/dist/steps/utils/android/gradle.d.ts +2 -1
  31. package/dist/steps/utils/android/gradle.js +2 -2
  32. package/dist/steps/utils/android/gradle.js.map +1 -1
  33. package/dist/steps/utils/expoUpdates.d.ts +4 -3
  34. package/dist/steps/utils/expoUpdates.js +26 -23
  35. package/dist/steps/utils/expoUpdates.js.map +1 -1
  36. package/dist/steps/utils/ios/fastlane.d.ts +7 -5
  37. package/dist/steps/utils/ios/fastlane.js +4 -2
  38. package/dist/steps/utils/ios/fastlane.js.map +1 -1
  39. package/dist/utils/expoUpdates.d.ts +13 -2
  40. package/dist/utils/expoUpdates.js +26 -16
  41. package/dist/utils/expoUpdates.js.map +1 -1
  42. package/package.json +4 -4
@@ -19,6 +19,7 @@ const injectAndroidCredentials_1 = require("../functions/injectAndroidCredential
19
19
  const configureAndroidVersion_1 = require("../functions/configureAndroidVersion");
20
20
  const useNpmToken_1 = require("../functions/useNpmToken");
21
21
  const resolveBuildConfig_1 = require("../functions/resolveBuildConfig");
22
+ const calculateEASUpdateRuntimeVersion_1 = require("../functions/calculateEASUpdateRuntimeVersion");
22
23
  function createEasBuildBuildFunctionGroup(buildToolsContext) {
23
24
  return new steps_1.BuildFunctionGroup({
24
25
  namespace: 'eas',
@@ -59,25 +60,35 @@ function createEasBuildBuildFunctionGroup(buildToolsContext) {
59
60
  }
60
61
  exports.createEasBuildBuildFunctionGroup = createEasBuildBuildFunctionGroup;
61
62
  function createStepsForIosSimulatorBuild({ globalCtx, buildToolsContext, }) {
63
+ const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
64
+ id: 'calculate_eas_update_runtime_version',
65
+ });
62
66
  const installPods = (0, installPods_1.createInstallPodsBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
63
67
  workingDirectory: './ios',
64
68
  });
65
69
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
66
70
  callInputs: {
67
71
  throw_if_not_configured: false,
72
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
73
+ },
74
+ });
75
+ const runFastlane = (0, runFastlane_1.runFastlaneFunction)().createBuildStepFromFunctionCall(globalCtx, {
76
+ id: 'run_fastlane',
77
+ callInputs: {
78
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
68
79
  },
69
80
  });
70
- const runFastlane = (0, runFastlane_1.runFastlaneFunction)();
71
81
  return [
72
82
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
73
83
  (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
74
84
  (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
75
85
  (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
76
86
  (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
87
+ calculateEASUpdateRuntimeVersion,
77
88
  installPods,
78
89
  configureEASUpdate,
79
90
  (0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)().createBuildStepFromFunctionCall(globalCtx),
80
- runFastlane.createBuildStepFromFunctionCall(globalCtx, { id: runFastlane.id }),
91
+ runFastlane,
81
92
  (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
82
93
  ];
83
94
  }
@@ -85,6 +96,9 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
85
96
  const resolveAppleTeamIdFromCredentials = (0, resolveAppleTeamIdFromCredentials_1.resolveAppleTeamIdFromCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx, {
86
97
  id: 'resolve_apple_team_id_from_credentials',
87
98
  });
99
+ const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
100
+ id: 'calculate_eas_update_runtime_version',
101
+ });
88
102
  const prebuildStep = (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx, {
89
103
  callInputs: {
90
104
  apple_team_id: '${ steps.resolve_apple_team_id_from_credentials.apple_team_id }',
@@ -96,6 +110,7 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
96
110
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
97
111
  callInputs: {
98
112
  throw_if_not_configured: false,
113
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
99
114
  },
100
115
  });
101
116
  const generateGymfile = (0, generateGymfileFromTemplate_1.generateGymfileFromTemplateFunction)().createBuildStepFromFunctionCall(globalCtx, {
@@ -103,7 +118,12 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
103
118
  credentials: '${ eas.job.secrets.buildCredentials }',
104
119
  },
105
120
  });
106
- const runFastlane = (0, runFastlane_1.runFastlaneFunction)();
121
+ const runFastlane = (0, runFastlane_1.runFastlaneFunction)().createBuildStepFromFunctionCall(globalCtx, {
122
+ id: 'run_fastlane',
123
+ callInputs: {
124
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
125
+ },
126
+ });
107
127
  return [
108
128
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
109
129
  (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
@@ -111,50 +131,71 @@ function createStepsForIosBuildWithCredentials({ globalCtx, buildToolsContext, }
111
131
  (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
112
132
  resolveAppleTeamIdFromCredentials,
113
133
  prebuildStep,
134
+ calculateEASUpdateRuntimeVersion,
114
135
  installPods,
115
136
  configureEASUpdate,
116
137
  (0, configureIosCredentials_1.configureIosCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx),
117
138
  (0, configureIosVersion_1.configureIosVersionFunction)().createBuildStepFromFunctionCall(globalCtx),
118
139
  generateGymfile,
119
- runFastlane.createBuildStepFromFunctionCall(globalCtx, { id: runFastlane.id }),
140
+ runFastlane,
120
141
  (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
121
142
  ];
122
143
  }
123
144
  function createStepsForAndroidBuildWithoutCredentials({ globalCtx, buildToolsContext, }) {
145
+ const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
146
+ id: 'calculate_eas_update_runtime_version',
147
+ });
124
148
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
125
149
  callInputs: {
126
150
  throw_if_not_configured: false,
151
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
152
+ },
153
+ });
154
+ const runGradle = (0, runGradle_1.runGradleFunction)().createBuildStepFromFunctionCall(globalCtx, {
155
+ id: 'run_gradle',
156
+ callInputs: {
157
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
127
158
  },
128
159
  });
129
- const runGradle = (0, runGradle_1.runGradleFunction)();
130
160
  return [
131
161
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
132
162
  (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
133
163
  (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
134
164
  (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
135
165
  (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
166
+ calculateEASUpdateRuntimeVersion,
136
167
  configureEASUpdate,
137
- runGradle.createBuildStepFromFunctionCall(globalCtx, { id: runGradle.id }),
168
+ runGradle,
138
169
  (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
139
170
  ];
140
171
  }
141
172
  function createStepsForAndroidBuildWithCredentials({ globalCtx, buildToolsContext, }) {
173
+ const calculateEASUpdateRuntimeVersion = (0, calculateEASUpdateRuntimeVersion_1.calculateEASUpdateRuntimeVersionFunction)().createBuildStepFromFunctionCall(globalCtx, {
174
+ id: 'calculate_eas_update_runtime_version',
175
+ });
142
176
  const configureEASUpdate = (0, configureEASUpdateIfInstalled_1.configureEASUpdateIfInstalledFunction)().createBuildStepFromFunctionCall(globalCtx, {
143
177
  callInputs: {
144
178
  throw_if_not_configured: false,
179
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
180
+ },
181
+ });
182
+ const runGradle = (0, runGradle_1.runGradleFunction)().createBuildStepFromFunctionCall(globalCtx, {
183
+ id: 'run_gradle',
184
+ callInputs: {
185
+ resolved_eas_update_runtime_version: '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',
145
186
  },
146
187
  });
147
- const runGradle = (0, runGradle_1.runGradleFunction)();
148
188
  return [
149
189
  (0, checkout_1.createCheckoutBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
150
190
  (0, useNpmToken_1.createSetUpNpmrcBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
151
191
  (0, installNodeModules_1.createInstallNodeModulesBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
152
192
  (0, resolveBuildConfig_1.createResolveBuildConfigBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
153
193
  (0, prebuild_1.createPrebuildBuildFunction)().createBuildStepFromFunctionCall(globalCtx),
194
+ calculateEASUpdateRuntimeVersion,
154
195
  configureEASUpdate,
155
196
  (0, injectAndroidCredentials_1.injectAndroidCredentialsFunction)().createBuildStepFromFunctionCall(globalCtx),
156
197
  (0, configureAndroidVersion_1.configureAndroidVersionFunction)().createBuildStepFromFunctionCall(globalCtx),
157
- runGradle.createBuildStepFromFunctionCall(globalCtx, { id: runGradle.id }),
198
+ runGradle,
158
199
  (0, findAndUploadBuildArtifacts_1.createFindAndUploadBuildArtifactsBuildFunction)(buildToolsContext).createBuildStepFromFunctionCall(globalCtx),
159
200
  ];
160
201
  }
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/steps/functionGroups/build.ts"],"names":[],"mappings":";;;AAAA,uCAAoF;AACpF,uDAA+C;AAE/C,oDAAoE;AACpE,wEAAwF;AACxF,oDAAoE;AACpE,0DAA0E;AAC1E,8FAAmG;AACnG,0FAA+F;AAC/F,0DAA+D;AAC/D,0FAA0G;AAE1G,sGAA2G;AAC3G,kFAAuF;AACvF,sDAA2D;AAC3D,0EAA+E;AAC/E,oFAAyF;AACzF,kFAAuF;AACvF,0DAAyE;AACzE,wEAAwF;AAOxF,SAAgB,gCAAgC,CAC9C,iBAAqC;IAErC,OAAO,IAAI,0BAAkB,CAAC;QAC5B,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,OAAO;QACX,qCAAqC,EAAE,CAAC,SAAS,EAAE,EAAE;;YACnD,IAAI,iBAAiB,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE,CAAC;gBACpD,wEAAwE;gBACxE,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,CAAA,MAAA,iBAAiB,CAAC,GAAG,CAAC,OAAO,0CAAE,gBAAgB,CAAA,EAAE,CAAC;oBACxF,OAAO,+BAA+B,CAAC;wBACrC,SAAS;wBACT,iBAAiB;qBAClB,CAAC,CAAC;gBACL,C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GACI;IACrB,MAAM,kBAAkB,GACtB,IAAA,qEAAqC,GAAE,CAAC,+BAA+B,CAAC,SAAS,EAAE;QACjF,UAAU,EAAE;YACV,uBAAuB,EAAE,KAAK;SAC/B;KACF,CAAC,CAAC;IACL,MAAM,SAAS,GAAG,IAAA,6BAAiB,GAAE,CAAC;IACtC,OAAO;QACL,IAAA,sCAA2B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QACxE,IAAA,2CAA6B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC1E,IAAA,0DAAqC,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAClF,IAAA,0DAAqC,EAAC,iBAAiB,CAAC,CAAC,+BAA+B,CACtF,SAAS,CACV;QACD,IAAA,sCAA2B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QACxE,kBAAkB;QAClB,IAAA,2DAAgC,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC7E,IAAA,yDAA+B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC5E,SAAS,CAAC,+BAA+B,CAAC,SAAS,EAAE,EAAE,EAAE,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC;QAC1E,IAAA,4EAA8C,EAC5C,iBAAiB,CAClB,CAAC,+BAA+B,CAAC,SAAS,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["import { BuildFunctionGroup, BuildStep, BuildStepGlobalContext } from '@expo/steps';\nimport { Platform } from '@expo/eas-build-job';\n\nimport { createCheckoutBuildFunction } from '../functions/checkout';\nimport { createInstallNodeModulesBuildFunction } from '../functions/installNodeModules';\nimport { createPrebuildBuildFunction } from '../functions/prebuild';\nimport { createInstallPodsBuildFunction } from '../functions/installPods';\nimport { configureEASUpdateIfInstalledFunction } from '../functions/configureEASUpdateIfInstalled';\nimport { generateGymfileFromTemplateFunction } from '../functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from '../functions/runFastlane';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from '../functions/findAndUploadBuildArtifacts';\nimport { CustomBuildContext } from '../../customBuildContext';\nimport { resolveAppleTeamIdFromCredentialsFunction } from '../functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from '../functions/configureIosCredentials';\nimport { runGradleFunction } from '../functions/runGradle';\nimport { configureIosVersionFunction } from '../functions/configureIosVersion';\nimport { injectAndroidCredentialsFunction } from '../functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from '../functions/configureAndroidVersion';\nimport { createSetUpNpmrcBuildFunction } from '../functions/useNpmToken';\nimport { createResolveBuildConfigBuildFunction } from '../functions/resolveBuildConfig';\n\ninterface HelperFunctionsInput {\n globalCtx: BuildStepGlobalContext;\n buildToolsContext: CustomBuildContext;\n}\n\nexport function createEasBuildBuildFunctionGroup(\n buildToolsContext: CustomBuildContext\n): BuildFunctionGroup {\n return new BuildFunctionGroup({\n namespace: 'eas',\n id: 'build',\n createBuildStepsFromFunctionGroupCall: (globalCtx) => {\n if (buildToolsContext.job.platform === Platform.IOS) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n if (buildToolsContext.job.simulator || !buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n } else {\n if (!buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n }\n },\n });\n}\n\nfunction createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n },\n });\n const runFastlane = runFastlaneFunction();\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n installPods,\n configureEASUpdate,\n generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(globalCtx),\n runFastlane.createBuildStepFromFunctionCall(globalCtx, { id: runFastlane.id }),\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const resolveAppleTeamIdFromCredentials =\n resolveAppleTeamIdFromCredentialsFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'resolve_apple_team_id_from_credentials',\n });\n const prebuildStep = createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n apple_team_id: '${ steps.resolve_apple_team_id_from_credentials.apple_team_id }',\n },\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n },\n });\n const generateGymfile = generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(\n globalCtx,\n {\n callInputs: {\n credentials: '${ eas.job.secrets.buildCredentials }',\n },\n }\n );\n const runFastlane = runFastlaneFunction();\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n resolveAppleTeamIdFromCredentials,\n prebuildStep,\n installPods,\n configureEASUpdate,\n configureIosCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureIosVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n generateGymfile,\n runFastlane.createBuildStepFromFunctionCall(globalCtx, { id: runFastlane.id }),\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n },\n });\n const runGradle = runGradleFunction();\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n configureEASUpdate,\n runGradle.createBuildStepFromFunctionCall(globalCtx, { id: runGradle.id }),\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n },\n });\n const runGradle = runGradleFunction();\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n configureEASUpdate,\n injectAndroidCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureAndroidVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n runGradle.createBuildStepFromFunctionCall(globalCtx, { id: runGradle.id }),\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n"]}
1
+ {"version":3,"file":"build.js","sourceRoot":"","sources":["../../../src/steps/functionGroups/build.ts"],"names":[],"mappings":";;;AAAA,uCAAoF;AACpF,uDAA+C;AAE/C,oDAAoE;AACpE,wEAAwF;AACxF,oDAAoE;AACpE,0DAA0E;AAC1E,8FAAmG;AACnG,0FAA+F;AAC/F,0DAA+D;AAC/D,0FAA0G;AAE1G,sGAA2G;AAC3G,kFAAuF;AACvF,sDAA2D;AAC3D,0EAA+E;AAC/E,oFAAyF;AACzF,kFAAuF;AACvF,0DAAyE;AACzE,wEAAwF;AACxF,oGAAyG;AAOzG,SAAgB,gCAAgC,CAC9C,iBAAqC;IAErC,OAAO,IAAI,0BAAkB,CAAC;QAC5B,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,OAAO;QACX,qCAAqC,EAAE,CAAC,SAAS,EAAE,EAAE;;YACnD,IAAI,iBAAiB,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,GAAG,EAAE,CAAC;gBACpD,wEAAwE;gBACxE,IAAI,iBAAiB,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,CAAA,MAAA,iBAAiB,CAAC,GAAG,CAAC,OAAO,0CAAE,gBAAgB,CAAA,EAAE,CAAC;oBACxF,OAAO,+BAA+B,CAAC;wBACrC,SAAS;w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C,SAAS,CAAC;QAC1E,IAAA,0DAAqC,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAClF,IAAA,0DAAqC,EAAC,iBAAiB,CAAC,CAAC,+BAA+B,CACtF,SAAS,CACV;QACD,IAAA,sCAA2B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QACxE,gCAAgC;QAChC,kBAAkB;QAClB,IAAA,2DAAgC,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC7E,IAAA,yDAA+B,GAAE,CAAC,+BAA+B,CAAC,SAAS,CAAC;QAC5E,SAAS;QACT,IAAA,4EAA8C,EAC5C,iBAAiB,CAClB,CAAC,+BAA+B,CAAC,SAAS,CAAC;KAC7C,CAAC;AACJ,CAAC","sourcesContent":["import { BuildFunctionGroup, BuildStep, BuildStepGlobalContext } from '@expo/steps';\nimport { Platform } from '@expo/eas-build-job';\n\nimport { createCheckoutBuildFunction } from '../functions/checkout';\nimport { createInstallNodeModulesBuildFunction } from '../functions/installNodeModules';\nimport { createPrebuildBuildFunction } from '../functions/prebuild';\nimport { createInstallPodsBuildFunction } from '../functions/installPods';\nimport { configureEASUpdateIfInstalledFunction } from '../functions/configureEASUpdateIfInstalled';\nimport { generateGymfileFromTemplateFunction } from '../functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from '../functions/runFastlane';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from '../functions/findAndUploadBuildArtifacts';\nimport { CustomBuildContext } from '../../customBuildContext';\nimport { resolveAppleTeamIdFromCredentialsFunction } from '../functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from '../functions/configureIosCredentials';\nimport { runGradleFunction } from '../functions/runGradle';\nimport { configureIosVersionFunction } from '../functions/configureIosVersion';\nimport { injectAndroidCredentialsFunction } from '../functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from '../functions/configureAndroidVersion';\nimport { createSetUpNpmrcBuildFunction } from '../functions/useNpmToken';\nimport { createResolveBuildConfigBuildFunction } from '../functions/resolveBuildConfig';\nimport { calculateEASUpdateRuntimeVersionFunction } from '../functions/calculateEASUpdateRuntimeVersion';\n\ninterface HelperFunctionsInput {\n globalCtx: BuildStepGlobalContext;\n buildToolsContext: CustomBuildContext;\n}\n\nexport function createEasBuildBuildFunctionGroup(\n buildToolsContext: CustomBuildContext\n): BuildFunctionGroup {\n return new BuildFunctionGroup({\n namespace: 'eas',\n id: 'build',\n createBuildStepsFromFunctionGroupCall: (globalCtx) => {\n if (buildToolsContext.job.platform === Platform.IOS) {\n // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing\n if (buildToolsContext.job.simulator || !buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n } else {\n if (!buildToolsContext.job.secrets?.buildCredentials) {\n return createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n });\n } else {\n return createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n });\n }\n }\n },\n });\n}\n\nfunction createStepsForIosSimulatorBuild({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runFastlane = runFastlaneFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_fastlane',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n installPods,\n configureEASUpdate,\n generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(globalCtx),\n runFastlane,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForIosBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const resolveAppleTeamIdFromCredentials =\n resolveAppleTeamIdFromCredentialsFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'resolve_apple_team_id_from_credentials',\n });\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const prebuildStep = createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n apple_team_id: '${ steps.resolve_apple_team_id_from_credentials.apple_team_id }',\n },\n });\n const installPods = createInstallPodsBuildFunction().createBuildStepFromFunctionCall(globalCtx, {\n workingDirectory: './ios',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const generateGymfile = generateGymfileFromTemplateFunction().createBuildStepFromFunctionCall(\n globalCtx,\n {\n callInputs: {\n credentials: '${ eas.job.secrets.buildCredentials }',\n },\n }\n );\n const runFastlane = runFastlaneFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_fastlane',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n resolveAppleTeamIdFromCredentials,\n prebuildStep,\n calculateEASUpdateRuntimeVersion,\n installPods,\n configureEASUpdate,\n configureIosCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureIosVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n generateGymfile,\n runFastlane,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithoutCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runGradle = runGradleFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_gradle',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n configureEASUpdate,\n runGradle,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n\nfunction createStepsForAndroidBuildWithCredentials({\n globalCtx,\n buildToolsContext,\n}: HelperFunctionsInput): BuildStep[] {\n const calculateEASUpdateRuntimeVersion =\n calculateEASUpdateRuntimeVersionFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'calculate_eas_update_runtime_version',\n });\n const configureEASUpdate =\n configureEASUpdateIfInstalledFunction().createBuildStepFromFunctionCall(globalCtx, {\n callInputs: {\n throw_if_not_configured: false,\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n const runGradle = runGradleFunction().createBuildStepFromFunctionCall(globalCtx, {\n id: 'run_gradle',\n callInputs: {\n resolved_eas_update_runtime_version:\n '${ steps.calculate_eas_update_runtime_version.resolved_eas_update_runtime_version }',\n },\n });\n return [\n createCheckoutBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createSetUpNpmrcBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createInstallNodeModulesBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n createResolveBuildConfigBuildFunction(buildToolsContext).createBuildStepFromFunctionCall(\n globalCtx\n ),\n createPrebuildBuildFunction().createBuildStepFromFunctionCall(globalCtx),\n calculateEASUpdateRuntimeVersion,\n configureEASUpdate,\n injectAndroidCredentialsFunction().createBuildStepFromFunctionCall(globalCtx),\n configureAndroidVersionFunction().createBuildStepFromFunctionCall(globalCtx),\n runGradle,\n createFindAndUploadBuildArtifactsBuildFunction(\n buildToolsContext\n ).createBuildStepFromFunctionCall(globalCtx),\n ];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { BuildFunction } from '@expo/steps';
2
+ export declare function calculateEASUpdateRuntimeVersionFunction(): BuildFunction;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateEASUpdateRuntimeVersionFunction = void 0;
4
+ const steps_1 = require("@expo/steps");
5
+ const expoUpdates_1 = require("../../utils/expoUpdates");
6
+ const appConfig_1 = require("../../utils/appConfig");
7
+ function calculateEASUpdateRuntimeVersionFunction() {
8
+ return new steps_1.BuildFunction({
9
+ namespace: 'eas',
10
+ id: 'calculate_eas_update_runtime_version',
11
+ name: 'Calculate EAS Update Runtime Version',
12
+ outputProviders: [
13
+ steps_1.BuildStepOutput.createProvider({
14
+ id: 'resolved_eas_update_runtime_version',
15
+ required: false,
16
+ }),
17
+ ],
18
+ fn: async (stepCtx, { env, outputs }) => {
19
+ var _a;
20
+ const appConfig = (0, appConfig_1.readAppConfig)({
21
+ projectDir: stepCtx.workingDirectory,
22
+ env: Object.keys(env).reduce((acc, key) => {
23
+ var _a;
24
+ acc[key] = (_a = env[key]) !== null && _a !== void 0 ? _a : '';
25
+ return acc;
26
+ }, {}),
27
+ logger: stepCtx.logger,
28
+ sdkVersion: (_a = stepCtx.global.staticContext.metadata) === null || _a === void 0 ? void 0 : _a.sdkVersion,
29
+ }).exp;
30
+ const resolvedRuntimeVersion = await (0, expoUpdates_1.resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync)({
31
+ cwd: stepCtx.workingDirectory,
32
+ logger: stepCtx.logger,
33
+ appConfig,
34
+ platform: stepCtx.global.staticContext.job.platform,
35
+ });
36
+ if (resolvedRuntimeVersion) {
37
+ outputs.resolved_eas_update_runtime_version.set(resolvedRuntimeVersion);
38
+ }
39
+ else {
40
+ stepCtx.logger.info('Skipped because EAS Update is not configured');
41
+ }
42
+ },
43
+ });
44
+ }
45
+ exports.calculateEASUpdateRuntimeVersionFunction = calculateEASUpdateRuntimeVersionFunction;
46
+ //# sourceMappingURL=calculateEASUpdateRuntimeVersion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calculateEASUpdateRuntimeVersion.js","sourceRoot":"","sources":["../../../src/steps/functions/calculateEASUpdateRuntimeVersion.ts"],"names":[],"mappings":";;;AAAA,uCAA6D;AAE7D,yDAA+F;AAC/F,qDAAsD;AAEtD,SAAgB,wCAAwC;IACtD,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sCAAsC;QAC1C,IAAI,EAAE,sCAAsC;QAC5C,eAAe,EAAE;YACf,uBAAe,CAAC,cAAc,CAAC;gBAC7B,EAAE,EAAE,qCAAqC;gBACzC,QAAQ,EAAE,KAAK;aAChB,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,EAAE,EAAE;;YACtC,MAAM,SAAS,GAAG,IAAA,yBAAa,EAAC;gBAC9B,UAAU,EAAE,OAAO,CAAC,gBAAgB;gBACpC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,MAAM,CAC1B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;;oBACX,GAAG,CAAC,GAAG,CAAC,GAAG,MAAA,GAAG,CAAC,GAAG,CAAC,mCAAI,EAAE,CAAC;oBAC1B,OAAO,GAAG,CAAC;gBACb,CAAC,EACD,EAA4B,CAC7B;gBACD,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,UAAU,EAAE,MAAA,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,0CAAE,UAAU;aAC9D,CAAC,CAAC,GAAG,CAAC;YACP,MAAM,sBAAsB,GAAG,MAAM,IAAA,kEAAoD,EAAC;gBACxF,GAAG,EAAE,OAAO,CAAC,gBAAgB;gBAC7B,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS;gBACT,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,CAAC,QAAQ;aACpD,CAAC,CAAC;YACH,IAAI,sBAAsB,EAAE,CAAC;gBAC3B,OAAO,CAAC,mCAAmC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;YAC1E,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAC;YACtE,CAAC;QACH,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AArCD,4FAqCC","sourcesContent":["import { BuildFunction, BuildStepOutput } from '@expo/steps';\n\nimport { resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync } from '../../utils/expoUpdates';\nimport { readAppConfig } from '../../utils/appConfig';\n\nexport function calculateEASUpdateRuntimeVersionFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'calculate_eas_update_runtime_version',\n name: 'Calculate EAS Update Runtime Version',\n outputProviders: [\n BuildStepOutput.createProvider({\n id: 'resolved_eas_update_runtime_version',\n required: false,\n }),\n ],\n fn: async (stepCtx, { env, outputs }) => {\n const appConfig = readAppConfig({\n projectDir: stepCtx.workingDirectory,\n env: Object.keys(env).reduce(\n (acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n },\n {} as Record<string, string>\n ),\n logger: stepCtx.logger,\n sdkVersion: stepCtx.global.staticContext.metadata?.sdkVersion,\n }).exp;\n const resolvedRuntimeVersion = await resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({\n cwd: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n platform: stepCtx.global.staticContext.job.platform,\n });\n if (resolvedRuntimeVersion) {\n outputs.resolved_eas_update_runtime_version.set(resolvedRuntimeVersion);\n } else {\n stepCtx.logger.info('Skipped because EAS Update is not configured');\n }\n },\n });\n}\n"]}
@@ -32,6 +32,11 @@ function configureEASUpdateIfInstalledFunction() {
32
32
  defaultValue: true,
33
33
  allowedValueTypeName: steps_1.BuildStepInputValueTypeName.BOOLEAN,
34
34
  }),
35
+ steps_1.BuildStepInput.createProvider({
36
+ id: 'resolved_eas_update_runtime_version',
37
+ required: false,
38
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
39
+ }),
35
40
  ],
36
41
  fn: async (stepCtx, { env, inputs }) => {
37
42
  (0, assert_1.default)(stepCtx.global.staticContext.job, 'Job is not defined');
@@ -49,6 +54,7 @@ function configureEASUpdateIfInstalledFunction() {
49
54
  }).exp;
50
55
  const releaseChannelInput = inputs.channel.value;
51
56
  const runtimeVersionInput = inputs.runtime_version.value;
57
+ const resolvedRuntimeVersionInput = inputs.resolved_eas_update_runtime_version.value;
52
58
  const throwIfNotConfigured = inputs.throw_if_not_configured.value;
53
59
  if (runtimeVersionInput && !semver_1.default.valid(runtimeVersionInput)) {
54
60
  throw new Error(`Runtime version provided by the "runtime_version" input is not a valid semver version: ${releaseChannelInput}`);
@@ -62,7 +68,6 @@ function configureEASUpdateIfInstalledFunction() {
62
68
  return;
63
69
  }
64
70
  await (0, expoUpdates_1.configureEASUpdateAsync)({
65
- expoUpdatesPackageVersion,
66
71
  job,
67
72
  workingDirectory: stepCtx.workingDirectory,
68
73
  logger: stepCtx.logger,
@@ -70,7 +75,9 @@ function configureEASUpdateIfInstalledFunction() {
70
75
  inputs: {
71
76
  runtimeVersion: runtimeVersionInput,
72
77
  channel: releaseChannelInput,
78
+ resolvedRuntimeVersion: resolvedRuntimeVersionInput,
73
79
  },
80
+ metadata: stepCtx.global.staticContext.metadata,
74
81
  });
75
82
  },
76
83
  });
@@ -1 +1 @@
1
- {"version":3,"file":"configureEASUpdateIfInstalled.js","sourceRoot":"","sources":["../../../src/steps/functions/configureEASUpdateIfInstalled.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAEzF,oDAA4B;AAE5B,sDAA+D;AAC/D,qDAAsD;AACtD,4IAAoH;AAEpH,SAAgB,qCAAqC;IACnD,OAAO,IAAI,qBAAa,CAAC;QACvB,SA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AM;gBACtB,UAAU,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU;aACjC,CAAC,CAAC,GAAG,CAAC;YAEP,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,CAAC,KAA2B,CAAC;YACvE,MAAM,mBAAmB,GAAG,MAAM,CAAC,eAAe,CAAC,KAA2B,CAAC;YAC/E,MAAM,oBAAoB,GAAG,MAAM,CAAC,uBAAuB,CAAC,KAAgB,CAAC;YAC7E,IAAI,mBAAmB,IAAI,CAAC,gBAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CAAC;gBAC9D,MAAM,IAAI,KAAK,CACb,0FAA0F,mBAAmB,EAAE,CAChH,CAAC;YACJ,CAAC;YAED,MAAM,yBAAyB,GAAG,MAAM,IAAA,sDAA4C,EAClF,OAAO,CAAC,gBAAgB,CACzB,CAAC;YACF,IAAI,yBAAyB,KAAK,IAAI,EAAE,CAAC;gBACvC,IAAI,oBAAoB,EAAE,CAAC;oBACzB,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,gFAAgF,CACjF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAM,IAAA,qCAAuB,EAAC;gBAC5B,yBAAyB;gBACzB,GAAG;gBACH,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;gBAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS;gBACT,MAAM,EAAE;oBACN,cAAc,EAAE,mBAAmB;oBACnC,OAAO,EAAE,mBAAmB;iBAC7B;aACF,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AA9ED,sFA8EC","sourcesContent":["import assert from 'assert';\n\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { Metadata } from '@expo/eas-build-job';\nimport semver from 'semver';\n\nimport { configureEASUpdateAsync } from '../utils/expoUpdates';\nimport { readAppConfig } from '../../utils/appConfig';\nimport getExpoUpdatesPackageVersionIfInstalledAsync from '../../utils/getExpoUpdatesPackageVersionIfInstalledAsync';\n\nexport function configureEASUpdateIfInstalledFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'configure_eas_update',\n name: 'Configure EAS Update',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'runtime_version',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'channel',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'throw_if_not_configured',\n required: false,\n defaultValue: true,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n ],\n fn: async (stepCtx, { env, inputs }) => {\n assert(stepCtx.global.staticContext.job, 'Job is not defined');\n const job = stepCtx.global.staticContext.job;\n const metadata = stepCtx.global.staticContext.metadata as Metadata | undefined;\n\n const appConfig = readAppConfig({\n projectDir: stepCtx.workingDirectory,\n env: Object.keys(env).reduce(\n (acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n },\n {} as Record<string, string>\n ),\n logger: stepCtx.logger,\n sdkVersion: metadata?.sdkVersion,\n }).exp;\n\n const releaseChannelInput = inputs.channel.value as string | undefined;\n const runtimeVersionInput = inputs.runtime_version.value as string | undefined;\n const throwIfNotConfigured = inputs.throw_if_not_configured.value as boolean;\n if (runtimeVersionInput && !semver.valid(runtimeVersionInput)) {\n throw new Error(\n `Runtime version provided by the \"runtime_version\" input is not a valid semver version: ${releaseChannelInput}`\n );\n }\n\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n stepCtx.workingDirectory\n );\n if (expoUpdatesPackageVersion === null) {\n if (throwIfNotConfigured) {\n throw new Error(\n 'Cannot configure EAS Update because the expo-updates package is not installed.'\n );\n }\n stepCtx.logger.warn(\n 'Cannot configure EAS Update because the expo-updates package is not installed.'\n );\n return;\n }\n\n await configureEASUpdateAsync({\n expoUpdatesPackageVersion,\n job,\n workingDirectory: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n inputs: {\n runtimeVersion: runtimeVersionInput,\n channel: releaseChannelInput,\n },\n });\n },\n });\n}\n"]}
1
+ {"version":3,"file":"configureEASUpdateIfInstalled.js","sourceRoot":"","sources":["../../../src/steps/functions/configureEASUpdateIfInstalled.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uCAAyF;AAEzF,oDAA4B;AAE5B,sDAA+D;AAC/D,qDAAsD;AACtD,4IAAoH;AAEpH,SAAgB,qCAAqC;IACnD,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,sBAAsB;QAC1B,IAAI,EAAE,sBAAsB;QAC5B,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,iBAAiB;gBACrB,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,SAAS;gBACb,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,yBAAyB;gBAC7B,QAAQ,EAAE,KAAK;gBACf,YAAY,EAAE,IAAI;gBAClB,oBAAoB,EAAE,mCAA2B,CAAC,OAAO;aAC1D,CAAC;YACF,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EAAE,qCAAqC;gBACzC,QAAQ,EAAE,KAAK;gBACf,oBAAoB,EAAE,mCAA2B,CAAC,MAAM;aACzD,CAAC;SACH;QACD,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE;YACrC,IAAA,gBAAM,EAAC,OAAO,CAAC,MAAM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AAI,oBAAoB,EAAE,CAAC;oBACzB,MAAM,IAAI,KAAK,CACb,gFAAgF,CACjF,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,MAAM,CAAC,IAAI,CACjB,gFAAgF,CACjF,CAAC;gBACF,OAAO;YACT,CAAC;YAED,MAAM,IAAA,qCAAuB,EAAC;gBAC5B,GAAG;gBACH,gBAAgB,EAAE,OAAO,CAAC,gBAAgB;gBAC1C,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,SAAS;gBACT,MAAM,EAAE;oBACN,cAAc,EAAE,mBAAmB;oBACnC,OAAO,EAAE,mBAAmB;oBAC5B,sBAAsB,EAAE,2BAA2B;iBACpD;gBACD,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ;aAChD,CAAC,CAAC;QACL,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAvFD,sFAuFC","sourcesContent":["import assert from 'assert';\n\nimport { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport { Metadata } from '@expo/eas-build-job';\nimport semver from 'semver';\n\nimport { configureEASUpdateAsync } from '../utils/expoUpdates';\nimport { readAppConfig } from '../../utils/appConfig';\nimport getExpoUpdatesPackageVersionIfInstalledAsync from '../../utils/getExpoUpdatesPackageVersionIfInstalledAsync';\n\nexport function configureEASUpdateIfInstalledFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'configure_eas_update',\n name: 'Configure EAS Update',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'runtime_version',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'channel',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n BuildStepInput.createProvider({\n id: 'throw_if_not_configured',\n required: false,\n defaultValue: true,\n allowedValueTypeName: BuildStepInputValueTypeName.BOOLEAN,\n }),\n BuildStepInput.createProvider({\n id: 'resolved_eas_update_runtime_version',\n required: false,\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n }),\n ],\n fn: async (stepCtx, { env, inputs }) => {\n assert(stepCtx.global.staticContext.job, 'Job is not defined');\n const job = stepCtx.global.staticContext.job;\n const metadata = stepCtx.global.staticContext.metadata as Metadata | undefined;\n\n const appConfig = readAppConfig({\n projectDir: stepCtx.workingDirectory,\n env: Object.keys(env).reduce(\n (acc, key) => {\n acc[key] = env[key] ?? '';\n return acc;\n },\n {} as Record<string, string>\n ),\n logger: stepCtx.logger,\n sdkVersion: metadata?.sdkVersion,\n }).exp;\n\n const releaseChannelInput = inputs.channel.value as string | undefined;\n const runtimeVersionInput = inputs.runtime_version.value as string | undefined;\n const resolvedRuntimeVersionInput = inputs.resolved_eas_update_runtime_version.value as\n | string\n | undefined;\n const throwIfNotConfigured = inputs.throw_if_not_configured.value as boolean;\n if (runtimeVersionInput && !semver.valid(runtimeVersionInput)) {\n throw new Error(\n `Runtime version provided by the \"runtime_version\" input is not a valid semver version: ${releaseChannelInput}`\n );\n }\n\n const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(\n stepCtx.workingDirectory\n );\n if (expoUpdatesPackageVersion === null) {\n if (throwIfNotConfigured) {\n throw new Error(\n 'Cannot configure EAS Update because the expo-updates package is not installed.'\n );\n }\n stepCtx.logger.warn(\n 'Cannot configure EAS Update because the expo-updates package is not installed.'\n );\n return;\n }\n\n await configureEASUpdateAsync({\n job,\n workingDirectory: stepCtx.workingDirectory,\n logger: stepCtx.logger,\n appConfig,\n inputs: {\n runtimeVersion: runtimeVersionInput,\n channel: releaseChannelInput,\n resolvedRuntimeVersion: resolvedRuntimeVersionInput,\n },\n metadata: stepCtx.global.staticContext.metadata,\n });\n },\n });\n}\n"]}
@@ -11,69 +11,38 @@ function createFindAndUploadBuildArtifactsBuildFunction(ctx) {
11
11
  id: 'find_and_upload_build_artifacts',
12
12
  name: 'Find and upload build artifacts',
13
13
  fn: async (stepCtx) => {
14
- var _a, _b;
15
- const { logger } = stepCtx;
16
- const applicationArchivePatternOrPath = ctx.job.platform === eas_build_job_1.Platform.ANDROID
17
- ? (_a = ctx.job.applicationArchivePath) !== null && _a !== void 0 ? _a : 'android/app/build/outputs/**/*.{apk,aab}'
18
- : resolveIosArtifactPath(ctx.job);
19
- const applicationArchives = await (0, artifacts_1.findArtifacts)({
20
- rootDir: stepCtx.workingDirectory,
21
- patternOrPath: applicationArchivePatternOrPath,
22
- logger,
23
- });
24
- logger.info(`Application archive${applicationArchives.length > 1 ? 's' : ''}: ${applicationArchives.join(', ')}`);
25
- const buildArtifacts = (await Promise.all(((_b = ctx.job.buildArtifactPaths) !== null && _b !== void 0 ? _b : []).map((path) => (0, artifacts_1.findArtifacts)({ rootDir: ctx.projectTargetDirectory, patternOrPath: path, logger })))).flat();
26
- if (buildArtifacts.length > 0) {
27
- logger.info(`Found additional build artifacts: ${buildArtifacts.join(', ')}`);
14
+ // We want each upload to print logs on its own
15
+ // and we don't want to interleave logs from different uploads
16
+ // so we execute uploads consecutively.
17
+ // Both application archive and build artifact uploads errors
18
+ // are throwing. We count the former as more important,
19
+ // so we save its for final throw.
20
+ let firstError = null;
21
+ try {
22
+ await uploadApplicationArchivesAsync({ ctx, stepCtx });
28
23
  }
29
- logger.info('Uploading...');
30
- const [archiveUpload, artifactsUpload, xcodeBuildLogsUpload] = await Promise.allSettled([
31
- ctx.runtimeApi.uploadArtifact({
32
- artifact: {
33
- type: eas_build_job_1.ManagedArtifactType.APPLICATION_ARCHIVE,
34
- paths: applicationArchives,
35
- },
36
- logger,
37
- }),
38
- (async () => {
39
- if (buildArtifacts.length > 0) {
40
- await ctx.runtimeApi.uploadArtifact({
41
- artifact: {
42
- type: eas_build_job_1.ManagedArtifactType.BUILD_ARTIFACTS,
43
- paths: buildArtifacts,
44
- },
45
- logger,
46
- });
47
- }
48
- })(),
49
- (async () => {
50
- if (ctx.job.platform !== eas_build_job_1.Platform.IOS) {
51
- return;
52
- }
53
- const xcodeBuildLogsPath = await (0, xcodeBuildLogs_1.findXcodeBuildLogsPathAsync)(stepCtx.global.buildLogsDirectory);
54
- if (xcodeBuildLogsPath) {
55
- await ctx.runtimeApi.uploadArtifact({
56
- artifact: {
57
- type: eas_build_job_1.ManagedArtifactType.XCODE_BUILD_LOGS,
58
- paths: [xcodeBuildLogsPath],
59
- },
60
- logger,
61
- });
62
- }
63
- })(),
64
- ]);
65
- if (archiveUpload.status === 'rejected') {
66
- logger.error('Failed to upload application archive.');
67
- throw archiveUpload.reason;
24
+ catch (err) {
25
+ stepCtx.logger.error(`Failed to upload application archives.`, err);
26
+ firstError || (firstError = err);
68
27
  }
69
- if (artifactsUpload.status === 'rejected') {
70
- logger.error('Failed to upload build artifacts.');
71
- throw artifactsUpload.reason;
28
+ try {
29
+ await uploadBuildArtifacts({ ctx, stepCtx });
72
30
  }
73
- if (xcodeBuildLogsUpload.status === 'rejected') {
74
- logger.error(`Failed to upload Xcode build logs. ${xcodeBuildLogsUpload.reason}`);
31
+ catch (err) {
32
+ stepCtx.logger.error(`Failed to upload build artifacts.`, err);
33
+ firstError || (firstError = err);
34
+ }
35
+ if (ctx.job.platform === eas_build_job_1.Platform.IOS) {
36
+ try {
37
+ await uploadXcodeBuildLogs({ ctx, stepCtx });
38
+ }
39
+ catch (err) {
40
+ stepCtx.logger.error(`Failed to upload Xcode build logs.`, err);
41
+ }
42
+ }
43
+ if (firstError) {
44
+ throw firstError;
75
45
  }
76
- logger.info('Upload finished');
77
46
  },
78
47
  });
79
48
  }
@@ -89,4 +58,62 @@ function resolveIosArtifactPath(job) {
89
58
  return 'ios/build/*.ipa';
90
59
  }
91
60
  }
61
+ async function uploadApplicationArchivesAsync({ ctx, stepCtx: { workingDirectory, logger }, }) {
62
+ var _a;
63
+ const applicationArchivePatternOrPath = ctx.job.platform === eas_build_job_1.Platform.ANDROID
64
+ ? (_a = ctx.job.applicationArchivePath) !== null && _a !== void 0 ? _a : 'android/app/build/outputs/**/*.{apk,aab}'
65
+ : resolveIosArtifactPath(ctx.job);
66
+ const applicationArchives = await (0, artifacts_1.findArtifacts)({
67
+ rootDir: workingDirectory,
68
+ patternOrPath: applicationArchivePatternOrPath,
69
+ logger,
70
+ });
71
+ if (applicationArchives.length === 0) {
72
+ throw new Error(`Found no application archives for "${applicationArchivePatternOrPath}".`);
73
+ }
74
+ const count = applicationArchives.length;
75
+ logger.info(`Found ${count} application archive${count > 1 ? 's' : ''}:\n- ${applicationArchives.join('\n- ')}`);
76
+ logger.info('Uploading...');
77
+ await ctx.runtimeApi.uploadArtifact({
78
+ artifact: {
79
+ type: eas_build_job_1.ManagedArtifactType.APPLICATION_ARCHIVE,
80
+ paths: applicationArchives,
81
+ },
82
+ logger,
83
+ });
84
+ logger.info('Done.');
85
+ }
86
+ async function uploadBuildArtifacts({ ctx, stepCtx: { workingDirectory, logger }, }) {
87
+ var _a;
88
+ const buildArtifacts = (await Promise.all(((_a = ctx.job.buildArtifactPaths) !== null && _a !== void 0 ? _a : []).map((path) => (0, artifacts_1.findArtifacts)({ rootDir: workingDirectory, patternOrPath: path, logger })))).flat();
89
+ if (buildArtifacts.length === 0) {
90
+ return;
91
+ }
92
+ logger.info(`Found additional build artifacts:\n- ${buildArtifacts.join('\n- ')}`);
93
+ logger.info('Uploading...');
94
+ await ctx.runtimeApi.uploadArtifact({
95
+ artifact: {
96
+ type: eas_build_job_1.ManagedArtifactType.BUILD_ARTIFACTS,
97
+ paths: buildArtifacts,
98
+ },
99
+ logger,
100
+ });
101
+ logger.info('Done.');
102
+ }
103
+ async function uploadXcodeBuildLogs({ ctx, stepCtx: { logger, global }, }) {
104
+ const xcodeBuildLogsPath = await (0, xcodeBuildLogs_1.findXcodeBuildLogsPathAsync)(global.buildLogsDirectory);
105
+ if (!xcodeBuildLogsPath) {
106
+ return;
107
+ }
108
+ logger.info(`Found Xcode build logs.`);
109
+ logger.info('Uploading...');
110
+ await ctx.runtimeApi.uploadArtifact({
111
+ artifact: {
112
+ type: eas_build_job_1.ManagedArtifactType.XCODE_BUILD_LOGS,
113
+ paths: [xcodeBuildLogsPath],
114
+ },
115
+ logger,
116
+ });
117
+ logger.info('Done.');
118
+ }
92
119
  //# sourceMappingURL=findAndUploadBuildArtifacts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../src/steps/functions/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAyE;AACzE,uCAA4C;AAE5C,qDAAsD;AACtD,6DAAuE;AAGvE,SAAgB,8CAA8C,CAC5D,GAAuB;IAEvB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;;YACpB,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;YAC3B,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,sBAAsB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,mBAAmB,GAAG,MAAM,IAAA,yBAAa,EAAC;gBAC9C,OAAO,EAAE,OAAO,CAAC,gBAAgB;gBACjC,aAAa,EAAE,+BAA+B;gBAC9C,MAAM;aACP,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CACT,sBACE,mBAAmB,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EACzC,KAAK,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACtC,CAAC;YACF,MAAM,cAAc,GAAG,CACrB,MAAM,OAAO,CAAC,GAAG,CACf,CAAC,MAAA,GAAG,CAAC,GAAG,CAAC,kBAAkB,mCAAI,EAAE,CAAC,CAA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M,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC;4BAClC,QAAQ,EAAE;gCACR,IAAI,EAAE,mCAAmB,CAAC,gBAAgB;gCAC1C,KAAK,EAAE,CAAC,kBAAkB,CAAC;6BAC5B;4BACD,MAAM;yBACP,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC,CAAC,EAAE;aACL,CAAC,CAAC;YACH,IAAI,aAAa,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBACxC,MAAM,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;gBACtD,MAAM,aAAa,CAAC,MAAM,CAAC;YAC7B,CAAC;YACD,IAAI,eAAe,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC1C,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;gBAClD,MAAM,eAAe,CAAC,MAAM,CAAC;YAC/B,CAAC;YACD,IAAI,oBAAoB,CAAC,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC/C,MAAM,CAAC,KAAK,CAAC,sCAAsC,oBAAoB,CAAC,MAAM,EAAE,CAAC,CAAC;YACpF,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QACjC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAtFD,wGAsFC;AAED,SAAS,sBAAsB,CAAC,GAAY;IAC1C,IAAI,GAAG,CAAC,sBAAsB,EAAE,CAAC;QAC/B,OAAO,GAAG,CAAC,sBAAsB,CAAC;IACpC,CAAC;SAAM,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;QACzB,OAAO,2CAA2C,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,OAAO,iBAAiB,CAAC;IAC3B,CAAC;AACH,CAAC","sourcesContent":["import { ManagedArtifactType, Ios, Platform } from '@expo/eas-build-job';\nimport { BuildFunction } from '@expo/steps';\n\nimport { findArtifacts } from '../../utils/artifacts';\nimport { findXcodeBuildLogsPathAsync } from '../../ios/xcodeBuildLogs';\nimport { CustomBuildContext } from '../../customBuildContext';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction(\n ctx: CustomBuildContext\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 (stepCtx) => {\n const { logger } = stepCtx;\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveIosArtifactPath(ctx.job);\n const applicationArchives = await findArtifacts({\n rootDir: stepCtx.workingDirectory,\n patternOrPath: applicationArchivePatternOrPath,\n logger,\n });\n logger.info(\n `Application archive${\n applicationArchives.length > 1 ? 's' : ''\n }: ${applicationArchives.join(', ')}`\n );\n const buildArtifacts = (\n await Promise.all(\n (ctx.job.buildArtifactPaths ?? []).map((path) =>\n findArtifacts({ rootDir: ctx.projectTargetDirectory, patternOrPath: path, logger })\n )\n )\n ).flat();\n if (buildArtifacts.length > 0) {\n logger.info(`Found additional build artifacts: ${buildArtifacts.join(', ')}`);\n }\n\n logger.info('Uploading...');\n const [archiveUpload, artifactsUpload, xcodeBuildLogsUpload] = await Promise.allSettled([\n ctx.runtimeApi.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.APPLICATION_ARCHIVE,\n paths: applicationArchives,\n },\n logger,\n }),\n (async () => {\n if (buildArtifacts.length > 0) {\n await ctx.runtimeApi.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.BUILD_ARTIFACTS,\n paths: buildArtifacts,\n },\n logger,\n });\n }\n })(),\n (async () => {\n if (ctx.job.platform !== Platform.IOS) {\n return;\n }\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(\n stepCtx.global.buildLogsDirectory\n );\n if (xcodeBuildLogsPath) {\n await ctx.runtimeApi.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.XCODE_BUILD_LOGS,\n paths: [xcodeBuildLogsPath],\n },\n logger,\n });\n }\n })(),\n ]);\n if (archiveUpload.status === 'rejected') {\n logger.error('Failed to upload application archive.');\n throw archiveUpload.reason;\n }\n if (artifactsUpload.status === 'rejected') {\n logger.error('Failed to upload build artifacts.');\n throw artifactsUpload.reason;\n }\n if (xcodeBuildLogsUpload.status === 'rejected') {\n logger.error(`Failed to upload Xcode build logs. ${xcodeBuildLogsUpload.reason}`);\n }\n logger.info('Upload finished');\n },\n });\n}\n\nfunction resolveIosArtifactPath(job: Ios.Job): string {\n if (job.applicationArchivePath) {\n return job.applicationArchivePath;\n } else if (job.simulator) {\n return 'ios/build/Build/Products/*simulator/*.app';\n } else {\n return 'ios/build/*.ipa';\n }\n}\n"]}
1
+ {"version":3,"file":"findAndUploadBuildArtifacts.js","sourceRoot":"","sources":["../../../src/steps/functions/findAndUploadBuildArtifacts.ts"],"names":[],"mappings":";;;AAAA,uDAAyE;AACzE,uCAA8D;AAE9D,qDAAsD;AACtD,6DAAuE;AAGvE,SAAgB,8CAA8C,CAC5D,GAAuB;IAEvB,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,iCAAiC;QACrC,IAAI,EAAE,iCAAiC;QACvC,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;YACpB,+CAA+C;YAC/C,8DAA8D;YAC9D,uCAAuC;YACvC,6DAA6D;YAC7D,uDAAuD;YACvD,kCAAkC;YAElC,IAAI,UAAU,GAAQ,IAAI,CAAC;YAE3B,IAAI,CAAC;gBACH,MAAM,8BAA8B,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;YACzD,CAAC;YAAC,OAAO,GAAY,EAAE,CAAC;gBACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,wCAAwC,EAAE,GAAG,CAAC,CAAC;gBACpE,UAAU,KAAV,UAAU,GAAK,GAAG,EAAC;YACrB,CAAC;YAED,IAAI,CAAC;gBACH,MAAM,oBAAoB,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;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AM,CAAC,IAAI,CAAC,wCAAwC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACnF,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC5B,MAAM,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC;QAClC,QAAQ,EAAE;YACR,IAAI,EAAE,mCAAmB,CAAC,eAAe;YACzC,KAAK,EAAE,cAAc;SACtB;QACD,MAAM;KACP,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AAED,KAAK,UAAU,oBAAoB,CAAC,EAClC,GAAG,EACH,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,GAI5B;IACC,MAAM,kBAAkB,GAAG,MAAM,IAAA,4CAA2B,EAAC,MAAM,CAAC,kBAAkB,CAAC,CAAC;IACxF,IAAI,CAAC,kBAAkB,EAAE,CAAC;QACxB,OAAO;IACT,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,CAAC;IACvC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC5B,MAAM,GAAG,CAAC,UAAU,CAAC,cAAc,CAAC;QAClC,QAAQ,EAAE;YACR,IAAI,EAAE,mCAAmB,CAAC,gBAAgB;YAC1C,KAAK,EAAE,CAAC,kBAAkB,CAAC;SAC5B;QACD,MAAM;KACP,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC","sourcesContent":["import { ManagedArtifactType, Ios, Platform } from '@expo/eas-build-job';\nimport { BuildFunction, BuildStepContext } from '@expo/steps';\n\nimport { findArtifacts } from '../../utils/artifacts';\nimport { findXcodeBuildLogsPathAsync } from '../../ios/xcodeBuildLogs';\nimport { CustomBuildContext } from '../../customBuildContext';\n\nexport function createFindAndUploadBuildArtifactsBuildFunction(\n ctx: CustomBuildContext\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 (stepCtx) => {\n // We want each upload to print logs on its own\n // and we don't want to interleave logs from different uploads\n // so we execute uploads consecutively.\n // Both application archive and build artifact uploads errors\n // are throwing. We count the former as more important,\n // so we save its for final throw.\n\n let firstError: any = null;\n\n try {\n await uploadApplicationArchivesAsync({ ctx, stepCtx });\n } catch (err: unknown) {\n stepCtx.logger.error(`Failed to upload application archives.`, err);\n firstError ||= err;\n }\n\n try {\n await uploadBuildArtifacts({ ctx, stepCtx });\n } catch (err: unknown) {\n stepCtx.logger.error(`Failed to upload build artifacts.`, err);\n firstError ||= err;\n }\n\n if (ctx.job.platform === Platform.IOS) {\n try {\n await uploadXcodeBuildLogs({ ctx, stepCtx });\n } catch (err: unknown) {\n stepCtx.logger.error(`Failed to upload Xcode build logs.`, err);\n }\n }\n\n if (firstError) {\n throw firstError;\n }\n },\n });\n}\n\nfunction resolveIosArtifactPath(job: Ios.Job): string {\n if (job.applicationArchivePath) {\n return job.applicationArchivePath;\n } else if (job.simulator) {\n return 'ios/build/Build/Products/*simulator/*.app';\n } else {\n return 'ios/build/*.ipa';\n }\n}\n\nasync function uploadApplicationArchivesAsync({\n ctx,\n stepCtx: { workingDirectory, logger },\n}: {\n ctx: CustomBuildContext;\n stepCtx: BuildStepContext;\n}): Promise<void> {\n const applicationArchivePatternOrPath =\n ctx.job.platform === Platform.ANDROID\n ? ctx.job.applicationArchivePath ?? 'android/app/build/outputs/**/*.{apk,aab}'\n : resolveIosArtifactPath(ctx.job);\n const applicationArchives = await findArtifacts({\n rootDir: workingDirectory,\n patternOrPath: applicationArchivePatternOrPath,\n logger,\n });\n\n if (applicationArchives.length === 0) {\n throw new Error(`Found no application archives for \"${applicationArchivePatternOrPath}\".`);\n }\n\n const count = applicationArchives.length;\n logger.info(\n `Found ${count} application archive${count > 1 ? 's' : ''}:\\n- ${applicationArchives.join(\n '\\n- '\n )}`\n );\n\n logger.info('Uploading...');\n await ctx.runtimeApi.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.APPLICATION_ARCHIVE,\n paths: applicationArchives,\n },\n logger,\n });\n logger.info('Done.');\n}\n\nasync function uploadBuildArtifacts({\n ctx,\n stepCtx: { workingDirectory, logger },\n}: {\n ctx: CustomBuildContext;\n stepCtx: BuildStepContext;\n}): Promise<void> {\n const buildArtifacts = (\n await Promise.all(\n (ctx.job.buildArtifactPaths ?? []).map((path) =>\n findArtifacts({ rootDir: workingDirectory, patternOrPath: path, logger })\n )\n )\n ).flat();\n if (buildArtifacts.length === 0) {\n return;\n }\n\n logger.info(`Found additional build artifacts:\\n- ${buildArtifacts.join('\\n- ')}`);\n logger.info('Uploading...');\n await ctx.runtimeApi.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.BUILD_ARTIFACTS,\n paths: buildArtifacts,\n },\n logger,\n });\n logger.info('Done.');\n}\n\nasync function uploadXcodeBuildLogs({\n ctx,\n stepCtx: { logger, global },\n}: {\n ctx: CustomBuildContext;\n stepCtx: BuildStepContext;\n}): Promise<void> {\n const xcodeBuildLogsPath = await findXcodeBuildLogsPathAsync(global.buildLogsDirectory);\n if (!xcodeBuildLogsPath) {\n return;\n }\n\n logger.info(`Found Xcode build logs.`);\n logger.info('Uploading...');\n await ctx.runtimeApi.uploadArtifact({\n artifact: {\n type: ManagedArtifactType.XCODE_BUILD_LOGS,\n paths: [xcodeBuildLogsPath],\n },\n logger,\n });\n logger.info('Done.');\n}\n"]}
@@ -19,18 +19,25 @@ function runFastlaneFunction() {
19
19
  required: false,
20
20
  }),
21
21
  ],
22
- fn: async (stepCtx, { env, outputs }) => {
22
+ inputProviders: [
23
+ steps_1.BuildStepInput.createProvider({
24
+ id: 'resolved_eas_update_runtime_version',
25
+ required: false,
26
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
27
+ }),
28
+ ],
29
+ fn: async (stepCtx, { env, outputs, inputs }) => {
23
30
  outputs[slackMessageDynamicFields_1.BuildStepOutputName.STATUS_TEXT].set(slackMessageDynamicFields_1.BuildStatusText.STARTED);
31
+ const resolvedEASUpdateRuntimeVersion = inputs.resolved_eas_update_runtime_version.value;
24
32
  try {
25
33
  await (0, fastlane_1.runFastlaneGym)({
26
34
  workingDir: stepCtx.workingDirectory,
27
- env: Object.keys(env).reduce((acc, key) => {
28
- var _a;
29
- acc[key] = (_a = env[key]) !== null && _a !== void 0 ? _a : '';
30
- return acc;
31
- }, {}),
35
+ env,
32
36
  logger: stepCtx.logger,
33
37
  buildLogsDirectory: stepCtx.global.buildLogsDirectory,
38
+ ...(resolvedEASUpdateRuntimeVersion
39
+ ? { extraEnv: { EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedEASUpdateRuntimeVersion } }
40
+ : null),
34
41
  });
35
42
  }
36
43
  catch (error) {