@expo/build-tools 1.0.67 → 1.0.68

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.
@@ -35,6 +35,7 @@ class CustomBuildContext {
35
35
  return {
36
36
  job: this.job,
37
37
  metadata: this.metadata,
38
+ env: this.env,
38
39
  };
39
40
  }
40
41
  updateEnv(env) {
@@ -1 +1 @@
1
- {"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,uDAA6F;AAE7F,uCAAiF;AAIjF,MAAM,8BAA8B,GAA2C;IAC7E,CAAC,wBAAQ,CAAC,OAAO,CAAC,EAAE,4BAAoB,CAAC,KAAK;IAC9C,CAAC,wBAAQ,CAAC,GAAG,CAAC,EAAE,4BAAoB,CAAC,MAAM;CAC5C,CAAC;AAMF,MAAa,kBAAkB;IA4B7B,YAAY,QAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,GAAG,CAAC;QACzB,IAAI,CAAC,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QAElC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,0BAAU,CAAC,MAAM,EAAE,CAAC,CAAC;QAClE,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;QACvF,IAAI,CAAC,sBAAsB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,uBAAuB,GAAG,QAAQ,CAAC,8BAA8B,EAAE,CAAC;QACzE,IAAI,CAAC,kBAAkB,GAAG,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG;YAChB,cAAc,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,GAAG,IAAI,CAAC;SACjE,CAAC;IACJ,CAAC;IAED,IAAW,eAAe;QACxB,OAAO,8BAA8B,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED,IAAW,GAAG;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,aAAa;QAClB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,GAAQ;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAEM,oBAAoB,CAAC,GAAQ,EAAE,QAAkB;QACtD,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,4BAAY,CAAC,qBAAqB,EAAE,CAAC;YAChE,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAvED,gDAuEC","sourcesContent":["import path from 'path';\n\nimport { BuildPhase, BuildTrigger, Env, Job, Metadata, Platform } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';\n\nimport { ArtifactToUpload, BuildContext } from './context';\n\nconst platformToBuildRuntimePlatform: Record<Platform, BuildRuntimePlatform> = {\n [Platform.ANDROID]: BuildRuntimePlatform.LINUX,\n [Platform.IOS]: BuildRuntimePlatform.DARWIN,\n};\n\nexport interface BuilderRuntimeApi {\n uploadArtifact: (spec: { artifact: ArtifactToUpload; logger: bunyan }) => Promise<void>;\n}\n\nexport class CustomBuildContext implements ExternalBuildContextProvider {\n /*\n * Directory that contains project sources before eas/checkout.\n */\n public readonly projectSourceDirectory: string;\n\n /*\n * Directory where build is executed. eas/checkout will copy sources here.\n */\n public readonly projectTargetDirectory: string;\n\n /*\n * Directory where all build steps will be executed unless configured otherwise.\n */\n public readonly defaultWorkingDirectory: string;\n\n /*\n * Directory where build logs will be stored unless configure otherwise.\n */\n public readonly buildLogsDirectory: string;\n\n public readonly logger: bunyan;\n public readonly runtimeApi: BuilderRuntimeApi;\n public job: Job;\n public metadata?: Metadata;\n\n private _env: Env;\n\n constructor(buildCtx: BuildContext<Job>) {\n this._env = buildCtx.env;\n this.job = buildCtx.job;\n this.metadata = buildCtx.metadata;\n\n this.logger = buildCtx.logger.child({ phase: BuildPhase.CUSTOM });\n this.projectSourceDirectory = path.join(buildCtx.workingdir, 'temporary-custom-build');\n this.projectTargetDirectory = path.join(buildCtx.workingdir, 'build');\n this.defaultWorkingDirectory = buildCtx.getReactNativeProjectDirectory();\n this.buildLogsDirectory = path.join(buildCtx.workingdir, 'logs');\n this.runtimeApi = {\n uploadArtifact: (...args) => buildCtx['uploadArtifact'](...args),\n };\n }\n\n public get runtimePlatform(): BuildRuntimePlatform {\n return platformToBuildRuntimePlatform[this.job.platform];\n }\n\n public get env(): Env {\n return this._env;\n }\n\n public staticContext(): any {\n return {\n job: this.job,\n metadata: this.metadata,\n };\n }\n\n public updateEnv(env: Env): void {\n this._env = env;\n }\n\n public updateJobInformation(job: Job, metadata: Metadata): void {\n if (this.job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating job information is only allowed when build was triggered by a git-based integration.'\n );\n }\n this.job = { ...job, triggeredBy: this.job.triggeredBy };\n this.metadata = metadata;\n }\n}\n"]}
1
+ {"version":3,"file":"customBuildContext.js","sourceRoot":"","sources":["../src/customBuildContext.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IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,aAAa;QAClB,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAC;IACJ,CAAC;IAEM,SAAS,CAAC,GAAQ;QACvB,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;IAClB,CAAC;IAEM,oBAAoB,CAAC,GAAQ,EAAE,QAAkB;QACtD,IAAI,IAAI,CAAC,GAAG,CAAC,WAAW,KAAK,4BAAY,CAAC,qBAAqB,EAAE,CAAC;YAChE,MAAM,IAAI,KAAK,CACb,+FAA+F,CAChG,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,GAAG,GAAG,EAAE,GAAG,GAAG,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAxED,gDAwEC","sourcesContent":["import path from 'path';\n\nimport { BuildPhase, BuildTrigger, Env, Job, Metadata, Platform } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExternalBuildContextProvider, BuildRuntimePlatform } from '@expo/steps';\n\nimport { ArtifactToUpload, BuildContext } from './context';\n\nconst platformToBuildRuntimePlatform: Record<Platform, BuildRuntimePlatform> = {\n [Platform.ANDROID]: BuildRuntimePlatform.LINUX,\n [Platform.IOS]: BuildRuntimePlatform.DARWIN,\n};\n\nexport interface BuilderRuntimeApi {\n uploadArtifact: (spec: { artifact: ArtifactToUpload; logger: bunyan }) => Promise<void>;\n}\n\nexport class CustomBuildContext implements ExternalBuildContextProvider {\n /*\n * Directory that contains project sources before eas/checkout.\n */\n public readonly projectSourceDirectory: string;\n\n /*\n * Directory where build is executed. eas/checkout will copy sources here.\n */\n public readonly projectTargetDirectory: string;\n\n /*\n * Directory where all build steps will be executed unless configured otherwise.\n */\n public readonly defaultWorkingDirectory: string;\n\n /*\n * Directory where build logs will be stored unless configure otherwise.\n */\n public readonly buildLogsDirectory: string;\n\n public readonly logger: bunyan;\n public readonly runtimeApi: BuilderRuntimeApi;\n public job: Job;\n public metadata?: Metadata;\n\n private _env: Env;\n\n constructor(buildCtx: BuildContext<Job>) {\n this._env = buildCtx.env;\n this.job = buildCtx.job;\n this.metadata = buildCtx.metadata;\n\n this.logger = buildCtx.logger.child({ phase: BuildPhase.CUSTOM });\n this.projectSourceDirectory = path.join(buildCtx.workingdir, 'temporary-custom-build');\n this.projectTargetDirectory = path.join(buildCtx.workingdir, 'build');\n this.defaultWorkingDirectory = buildCtx.getReactNativeProjectDirectory();\n this.buildLogsDirectory = path.join(buildCtx.workingdir, 'logs');\n this.runtimeApi = {\n uploadArtifact: (...args) => buildCtx['uploadArtifact'](...args),\n };\n }\n\n public get runtimePlatform(): BuildRuntimePlatform {\n return platformToBuildRuntimePlatform[this.job.platform];\n }\n\n public get env(): Env {\n return this._env;\n }\n\n public staticContext(): any {\n return {\n job: this.job,\n metadata: this.metadata,\n env: this.env,\n };\n }\n\n public updateEnv(env: Env): void {\n this._env = env;\n }\n\n public updateJobInformation(job: Job, metadata: Metadata): void {\n if (this.job.triggeredBy !== BuildTrigger.GIT_BASED_INTEGRATION) {\n throw new Error(\n 'Updating job information is only allowed when build was triggered by a git-based integration.'\n );\n }\n this.job = { ...job, triggeredBy: this.job.triggeredBy };\n this.metadata = metadata;\n }\n}\n"]}
@@ -21,6 +21,7 @@ const startIosSimulator_1 = require("./functions/startIosSimulator");
21
21
  const installMaestro_1 = require("./functions/installMaestro");
22
22
  const getCredentialsForBuildTriggeredByGitHubIntegration_1 = require("./functions/getCredentialsForBuildTriggeredByGitHubIntegration");
23
23
  const installPods_1 = require("./functions/installPods");
24
+ const sendSlackMessage_1 = require("./functions/sendSlackMessage");
24
25
  function getEasFunctions(ctx) {
25
26
  return [
26
27
  (0, checkout_1.createCheckoutBuildFunction)(),
@@ -43,6 +44,7 @@ function getEasFunctions(ctx) {
43
44
  (0, installMaestro_1.createInstallMaestroBuildFunction)(),
44
45
  (0, getCredentialsForBuildTriggeredByGitHubIntegration_1.createGetCredentialsForBuildTriggeredByGithubIntegration)(ctx),
45
46
  (0, installPods_1.createInstallPodsBuildFunction)(),
47
+ (0, sendSlackMessage_1.createSendSlackMessageFunction)(),
46
48
  ];
47
49
  }
48
50
  exports.getEasFunctions = getEasFunctions;
@@ -1 +1 @@
1
- {"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAIA,+DAA+E;AAC/E,mDAAmE;AACnE,yDAAwE;AACxE,uEAAuF;AACvF,mDAAmE;AACnE,yFAAyG;AACzG,6FAAkG;AAClG,mFAAwF;AACxF,iFAAsF;AACtF,qDAA0D;AAC1D,qGAA0G;AAC1G,iFAAsF;AACtF,yEAA8E;AAC9E,yFAA8F;AAC9F,yDAA8D;AAC9D,2EAA2F;AAC3F,qEAAqF;AACrF,+DAA+E;AAC/E,uIAA0I;AAC1I,yDAAyE;AAEzE,SAAgB,eAAe,CAAC,GAAuB;IACrD,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,2CAA6B,GAAE;QAC/B,IAAA,0DAAqC,GAAE;QACvC,IAAA,sCAA2B,GAAE;QAC7B,IAAA,4EAA8C,EAAC,GAAG,CAAC;QACnD,IAAA,qEAAqC,GAAE;QACvC,IAAA,2DAAgC,GAAE;QAClC,IAAA,yDAA+B,GAAE;QACjC,IAAA,6BAAiB,GAAE;QACnB,IAAA,6EAAyC,GAAE;QAC3C,IAAA,yDAA+B,GAAE;QACjC,IAAA,iDAA2B,GAAE;QAC7B,IAAA,iEAAmC,GAAE;QACrC,IAAA,iCAAmB,GAAE;QACrB,IAAA,8DAAuC,GAAE;QACzC,IAAA,wDAAoC,GAAE;QACtC,IAAA,kDAAiC,GAAE;QACnC,IAAA,6GAAwD,EAAC,GAAG,CAAC;QAC7D,IAAA,4CAA8B,GAAE;KACjC,CAAC;AACJ,CAAC;AAvBD,0CAuBC","sourcesContent":["import { BuildFunction } from '@expo/steps';\n\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createUploadArtifactBuildFunction } from './functions/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/useNpmToken';\nimport { createInstallNodeModulesBuildFunction } from './functions/installNodeModules';\nimport { createPrebuildBuildFunction } from './functions/prebuild';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/findAndUploadBuildArtifacts';\nimport { configureEASUpdateIfInstalledFunction } from './functions/configureEASUpdateIfInstalled';\nimport { injectAndroidCredentialsFunction } from './functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from './functions/configureAndroidVersion';\nimport { runGradleFunction } from './functions/runGradle';\nimport { resolveAppleTeamIdFromCredentialsFunction } from './functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from './functions/configureIosCredentials';\nimport { configureIosVersionFunction } from './functions/configureIosVersion';\nimport { generateGymfileFromTemplateFunction } from './functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from './functions/runFastlane';\nimport { createStartAndroidEmulatorBuildFunction } from './functions/startAndroidEmulator';\nimport { createStartIosSimulatorBuildFunction } from './functions/startIosSimulator';\nimport { createInstallMaestroBuildFunction } from './functions/installMaestro';\nimport { createGetCredentialsForBuildTriggeredByGithubIntegration } from './functions/getCredentialsForBuildTriggeredByGitHubIntegration';\nimport { createInstallPodsBuildFunction } from './functions/installPods';\n\nexport function getEasFunctions(ctx: CustomBuildContext): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(),\n createInstallNodeModulesBuildFunction(),\n createPrebuildBuildFunction(),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n configureEASUpdateIfInstalledFunction(),\n injectAndroidCredentialsFunction(),\n configureAndroidVersionFunction(),\n runGradleFunction(),\n resolveAppleTeamIdFromCredentialsFunction(),\n configureIosCredentialsFunction(),\n configureIosVersionFunction(),\n generateGymfileFromTemplateFunction(),\n runFastlaneFunction(),\n createStartAndroidEmulatorBuildFunction(),\n createStartIosSimulatorBuildFunction(),\n createInstallMaestroBuildFunction(),\n createGetCredentialsForBuildTriggeredByGithubIntegration(ctx),\n createInstallPodsBuildFunction(),\n ];\n}\n"]}
1
+ {"version":3,"file":"easFunctions.js","sourceRoot":"","sources":["../../src/steps/easFunctions.ts"],"names":[],"mappings":";;;AAIA,+DAA+E;AAC/E,mDAAmE;AACnE,yDAAwE;AACxE,uEAAuF;AACvF,mDAAmE;AACnE,yFAAyG;AACzG,6FAAkG;AAClG,mFAAwF;AACxF,iFAAsF;AACtF,qDAA0D;AAC1D,qGAA0G;AAC1G,iFAAsF;AACtF,yEAA8E;AAC9E,yFAA8F;AAC9F,yDAA8D;AAC9D,2EAA2F;AAC3F,qEAAqF;AACrF,+DAA+E;AAC/E,uIAA0I;AAC1I,yDAAyE;AACzE,mEAA8E;AAE9E,SAAgB,eAAe,CAAC,GAAuB;IACrD,OAAO;QACL,IAAA,sCAA2B,GAAE;QAC7B,IAAA,kDAAiC,EAAC,GAAG,CAAC;QACtC,IAAA,2CAA6B,GAAE;QAC/B,IAAA,0DAAqC,GAAE;QACvC,IAAA,sCAA2B,GAAE;QAC7B,IAAA,4EAA8C,EAAC,GAAG,CAAC;QACnD,IAAA,qEAAqC,GAAE;QACvC,IAAA,2DAAgC,GAAE;QAClC,IAAA,yDAA+B,GAAE;QACjC,IAAA,6BAAiB,GAAE;QACnB,IAAA,6EAAyC,GAAE;QAC3C,IAAA,yDAA+B,GAAE;QACjC,IAAA,iDAA2B,GAAE;QAC7B,IAAA,iEAAmC,GAAE;QACrC,IAAA,iCAAmB,GAAE;QACrB,IAAA,8DAAuC,GAAE;QACzC,IAAA,wDAAoC,GAAE;QACtC,IAAA,kDAAiC,GAAE;QACnC,IAAA,6GAAwD,EAAC,GAAG,CAAC;QAC7D,IAAA,4CAA8B,GAAE;QAChC,IAAA,iDAA8B,GAAE;KACjC,CAAC;AACJ,CAAC;AAxBD,0CAwBC","sourcesContent":["import { BuildFunction } from '@expo/steps';\n\nimport { CustomBuildContext } from '../customBuildContext';\n\nimport { createUploadArtifactBuildFunction } from './functions/uploadArtifact';\nimport { createCheckoutBuildFunction } from './functions/checkout';\nimport { createSetUpNpmrcBuildFunction } from './functions/useNpmToken';\nimport { createInstallNodeModulesBuildFunction } from './functions/installNodeModules';\nimport { createPrebuildBuildFunction } from './functions/prebuild';\nimport { createFindAndUploadBuildArtifactsBuildFunction } from './functions/findAndUploadBuildArtifacts';\nimport { configureEASUpdateIfInstalledFunction } from './functions/configureEASUpdateIfInstalled';\nimport { injectAndroidCredentialsFunction } from './functions/injectAndroidCredentials';\nimport { configureAndroidVersionFunction } from './functions/configureAndroidVersion';\nimport { runGradleFunction } from './functions/runGradle';\nimport { resolveAppleTeamIdFromCredentialsFunction } from './functions/resolveAppleTeamIdFromCredentials';\nimport { configureIosCredentialsFunction } from './functions/configureIosCredentials';\nimport { configureIosVersionFunction } from './functions/configureIosVersion';\nimport { generateGymfileFromTemplateFunction } from './functions/generateGymfileFromTemplate';\nimport { runFastlaneFunction } from './functions/runFastlane';\nimport { createStartAndroidEmulatorBuildFunction } from './functions/startAndroidEmulator';\nimport { createStartIosSimulatorBuildFunction } from './functions/startIosSimulator';\nimport { createInstallMaestroBuildFunction } from './functions/installMaestro';\nimport { createGetCredentialsForBuildTriggeredByGithubIntegration } from './functions/getCredentialsForBuildTriggeredByGitHubIntegration';\nimport { createInstallPodsBuildFunction } from './functions/installPods';\nimport { createSendSlackMessageFunction } from './functions/sendSlackMessage';\n\nexport function getEasFunctions(ctx: CustomBuildContext): BuildFunction[] {\n return [\n createCheckoutBuildFunction(),\n createUploadArtifactBuildFunction(ctx),\n createSetUpNpmrcBuildFunction(),\n createInstallNodeModulesBuildFunction(),\n createPrebuildBuildFunction(),\n createFindAndUploadBuildArtifactsBuildFunction(ctx),\n configureEASUpdateIfInstalledFunction(),\n injectAndroidCredentialsFunction(),\n configureAndroidVersionFunction(),\n runGradleFunction(),\n resolveAppleTeamIdFromCredentialsFunction(),\n configureIosCredentialsFunction(),\n configureIosVersionFunction(),\n generateGymfileFromTemplateFunction(),\n runFastlaneFunction(),\n createStartAndroidEmulatorBuildFunction(),\n createStartIosSimulatorBuildFunction(),\n createInstallMaestroBuildFunction(),\n createGetCredentialsForBuildTriggeredByGithubIntegration(ctx),\n createInstallPodsBuildFunction(),\n createSendSlackMessageFunction(),\n ];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { BuildFunction } from '@expo/steps';
2
+ export declare function createSendSlackMessageFunction(): BuildFunction;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.createSendSlackMessageFunction = void 0;
7
+ const steps_1 = require("@expo/steps");
8
+ const node_fetch_1 = __importDefault(require("node-fetch"));
9
+ function createSendSlackMessageFunction() {
10
+ return new steps_1.BuildFunction({
11
+ namespace: 'eas',
12
+ id: 'send_slack_message',
13
+ name: 'Send Slack message',
14
+ inputProviders: [
15
+ steps_1.BuildStepInput.createProvider({
16
+ id: 'message',
17
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
18
+ required: true,
19
+ }),
20
+ steps_1.BuildStepInput.createProvider({
21
+ id: 'slack_hook_url',
22
+ allowedValueTypeName: steps_1.BuildStepInputValueTypeName.STRING,
23
+ required: false,
24
+ }),
25
+ ],
26
+ fn: async (stepCtx, { inputs, env }) => {
27
+ var _a;
28
+ const { logger } = stepCtx;
29
+ const slackMessage = inputs.message.value;
30
+ const slackHookUrl = (_a = inputs.slack_hook_url.value) !== null && _a !== void 0 ? _a : env.SLACK_HOOK_URL;
31
+ if (!slackHookUrl) {
32
+ logger.warn('Slack webhook URL not provided - provide input "slack_hook_url" or set "SLACK_HOOK_URL" secret');
33
+ throw new Error('Sending Slack message failed - provide input "slack_hook_url" or set "SLACK_HOOK_URL" secret');
34
+ }
35
+ await sendSlackMessageAsync({ logger, slackHookUrl, slackMessage });
36
+ },
37
+ });
38
+ }
39
+ exports.createSendSlackMessageFunction = createSendSlackMessageFunction;
40
+ async function sendSlackMessageAsync({ logger, slackHookUrl, slackMessage, }) {
41
+ logger.info('Sending Slack message');
42
+ const body = { text: slackMessage };
43
+ let fetchResult;
44
+ try {
45
+ fetchResult = await (0, node_fetch_1.default)(slackHookUrl, {
46
+ method: 'POST',
47
+ body: JSON.stringify(body),
48
+ headers: { 'Content-Type': 'application/json' },
49
+ });
50
+ }
51
+ catch (error) {
52
+ logger.warn(`Sending Slack message to webhook url "${slackHookUrl}" failed`);
53
+ logger.debug(error);
54
+ throw new Error(`Sending Slack message to webhook url "${slackHookUrl}" failed`);
55
+ }
56
+ if (!fetchResult.ok) {
57
+ logger.warn(`Sending Slack message to webhook url "${slackHookUrl}" failed with status ${fetchResult.status}`);
58
+ logger.debug(`${fetchResult.status} - ${fetchResult.statusText}`);
59
+ throw new Error(`Sending Slack message to webhook url "${slackHookUrl}" failed with status ${fetchResult.status}`);
60
+ }
61
+ logger.info('Slack message sent successfully');
62
+ }
63
+ //# sourceMappingURL=sendSlackMessage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendSlackMessage.js","sourceRoot":"","sources":["../../../src/steps/functions/sendSlackMessage.ts"],"names":[],"mappings":";;;;;;AAAA,uCAAyF;AACzF,4DAA6C;AAG7C,SAAgB,8BAA8B;IAC5C,OAAO,IAAI,qBAAa,CAAC;QACvB,SAAS,EAAE,KAAK;QAChB,EAAE,EAAE,oBAAoB;QACxB,IAAI,EAAE,oBAAoB;QAC1B,cAAc,EAAE;YACd,sBAAc,CAAC,cAAc,CAAC;gBAC5B,EAAE,EA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L,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,IAAI,CAAC,yCAAyC,YAAY,UAAU,CAAC,CAAC;QAC7E,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,yCAAyC,YAAY,UAAU,CAAC,CAAC;IACnF,CAAC;IACD,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;QACpB,MAAM,CAAC,IAAI,CACT,yCAAyC,YAAY,wBAAwB,WAAW,CAAC,MAAM,EAAE,CAClG,CAAC;QACF,MAAM,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,MAAM,WAAW,CAAC,UAAU,EAAE,CAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CACb,yCAAyC,YAAY,wBAAwB,WAAW,CAAC,MAAM,EAAE,CAClG,CAAC;IACJ,CAAC;IACD,MAAM,CAAC,IAAI,CAAC,iCAAiC,CAAC,CAAC;AACjD,CAAC","sourcesContent":["import { BuildFunction, BuildStepInput, BuildStepInputValueTypeName } from '@expo/steps';\nimport fetch, { Response } from 'node-fetch';\nimport { bunyan } from '@expo/logger';\n\nexport function createSendSlackMessageFunction(): BuildFunction {\n return new BuildFunction({\n namespace: 'eas',\n id: 'send_slack_message',\n name: 'Send Slack message',\n inputProviders: [\n BuildStepInput.createProvider({\n id: 'message',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: true,\n }),\n BuildStepInput.createProvider({\n id: 'slack_hook_url',\n allowedValueTypeName: BuildStepInputValueTypeName.STRING,\n required: false,\n }),\n ],\n fn: async (stepCtx, { inputs, env }) => {\n const { logger } = stepCtx;\n const slackMessage = inputs.message.value as string;\n const slackHookUrl = (inputs.slack_hook_url.value as string) ?? env.SLACK_HOOK_URL;\n if (!slackHookUrl) {\n logger.warn(\n 'Slack webhook URL not provided - provide input \"slack_hook_url\" or set \"SLACK_HOOK_URL\" secret'\n );\n throw new Error(\n 'Sending Slack message failed - provide input \"slack_hook_url\" or set \"SLACK_HOOK_URL\" secret'\n );\n }\n await sendSlackMessageAsync({ logger, slackHookUrl, slackMessage });\n },\n });\n}\n\nasync function sendSlackMessageAsync({\n logger,\n slackHookUrl,\n slackMessage,\n}: {\n logger: bunyan;\n slackHookUrl: string;\n slackMessage: string;\n}): Promise<void> {\n logger.info('Sending Slack message');\n\n const body = { text: slackMessage };\n let fetchResult: Response;\n try {\n fetchResult = await fetch(slackHookUrl, {\n method: 'POST',\n body: JSON.stringify(body),\n headers: { 'Content-Type': 'application/json' },\n });\n } catch (error) {\n logger.warn(`Sending Slack message to webhook url \"${slackHookUrl}\" failed`);\n logger.debug(error);\n throw new Error(`Sending Slack message to webhook url \"${slackHookUrl}\" failed`);\n }\n if (!fetchResult.ok) {\n logger.warn(\n `Sending Slack message to webhook url \"${slackHookUrl}\" failed with status ${fetchResult.status}`\n );\n logger.debug(`${fetchResult.status} - ${fetchResult.statusText}`);\n throw new Error(\n `Sending Slack message to webhook url \"${slackHookUrl}\" failed with status ${fetchResult.status}`\n );\n }\n logger.info('Slack message sent successfully');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/build-tools",
3
- "version": "1.0.67",
3
+ "version": "1.0.68",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [
@@ -37,6 +37,7 @@
37
37
  "fs-extra": "^11.2.0",
38
38
  "joi": "^17.11.0",
39
39
  "lodash": "^4.17.21",
40
+ "node-fetch": "^2.7.0",
40
41
  "node-forge": "^1.3.1",
41
42
  "nullthrows": "^1.1.1",
42
43
  "plist": "^3.1.0",
@@ -48,6 +49,7 @@
48
49
  "@types/jest": "^29.5.11",
49
50
  "@types/lodash": "^4.14.202",
50
51
  "@types/node": "20.11.0",
52
+ "@types/node-fetch": "^2.6.11",
51
53
  "@types/node-forge": "^1.3.11",
52
54
  "@types/plist": "^3.0.5",
53
55
  "@types/semver": "^7.5.6",
@@ -67,5 +69,5 @@
67
69
  "node": "20.11.0",
68
70
  "yarn": "1.22.21"
69
71
  },
70
- "gitHead": "60906948aff9b633c1b10632634da0fc76f821da"
72
+ "gitHead": "ad072d4ae27881cb1eeaced32c4b9f5faee0f9b5"
71
73
  }