Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/build-tools/src/builders/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ async function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {
logger: ctx.logger,
appConfig: ctx.appConfig,
platform: ctx.job.platform,
workflow: ctx.job.type,
});
}
);
Expand Down Expand Up @@ -105,7 +106,12 @@ async function buildAsync(ctx: BuildContext<Android.Job>): Promise<void> {
gradleCommand,
androidDir: path.join(ctx.getReactNativeProjectDirectory(), 'android'),
...(resolvedExpoUpdatesRuntimeVersion
? { extraEnv: { EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion } }
? {
extraEnv: {
EXPO_UPDATES_FINGERPRINT_OVERRIDE: resolvedExpoUpdatesRuntimeVersion,
EXPO_UPDATES_WORKFLOW_OVERRIDE: ctx.job.type,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this isn't technically needed since this is only used if EXPO_UPDATES_FINGERPRINT_OVERRIDE isn't provided, but worth adding for consistency just in case someone puts up a project that uses it.

},
}
: null),
});
});
Expand Down
1 change: 1 addition & 0 deletions packages/build-tools/src/builders/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ async function buildAsync(ctx: BuildContext<Ios.Job>): Promise<void> {
logger: ctx.logger,
appConfig: ctx.appConfig,
platform: ctx.job.platform,
workflow: ctx.job.type,
});
}
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform } from '@expo/eas-build-job';
import { Platform, Workflow } from '@expo/eas-build-job';
import {
BuildFunction,
BuildStepInput,
Expand All @@ -22,6 +22,12 @@ export function calculateEASUpdateRuntimeVersionFunction(ctx: CustomBuildContext
required: !ctx.job.platform,
allowedValueTypeName: BuildStepInputValueTypeName.STRING,
}),
BuildStepInput.createProvider({
id: 'workflow',
defaultValue: ctx.job.type,
required: !ctx.job.type,
allowedValueTypeName: BuildStepInputValueTypeName.STRING,
}),
],
outputProviders: [
BuildStepOutput.createProvider({
Expand All @@ -47,6 +53,7 @@ export function calculateEASUpdateRuntimeVersionFunction(ctx: CustomBuildContext
logger: stepCtx.logger,
appConfig,
platform: inputs.platform.value as Platform,
workflow: inputs.workflow.value as Workflow,
});
if (resolvedRuntimeVersion) {
outputs.resolved_eas_update_runtime_version.set(resolvedRuntimeVersion);
Expand Down
5 changes: 4 additions & 1 deletion packages/build-tools/src/utils/expoUpdates.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import assert from 'assert';

import { Platform, Job, BuildJob } from '@expo/eas-build-job';
import { Platform, Job, BuildJob, Workflow } from '@expo/eas-build-job';
import semver from 'semver';
import { ExpoConfig } from '@expo/config';
import { bunyan } from '@expo/logger';
Expand Down Expand Up @@ -215,11 +215,13 @@ export async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
cwd,
appConfig,
platform,
workflow,
logger,
}: {
cwd: string;
appConfig: ExpoConfig;
platform: Platform;
workflow: Workflow;
logger: bunyan;
}): Promise<string | null> {
const expoUpdatesPackageVersion = await getExpoUpdatesPackageVersionIfInstalledAsync(cwd, logger);
Expand All @@ -231,6 +233,7 @@ export async function resolveRuntimeVersionForExpoUpdatesIfConfiguredAsync({
projectDir: cwd,
exp: appConfig,
platform,
workflow,
logger,
expoUpdatesPackageVersion,
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import { ExpoConfig } from '@expo/config';
import { Updates } from '@expo/config-plugins';
import { bunyan } from '@expo/logger';
import { Workflow } from '@expo/eas-build-job';

import { ExpoUpdatesCLIModuleNotFoundError, expoUpdatesCommandAsync } from './expoUpdatesCli';
import { isModernExpoUpdatesCLIWithRuntimeVersionCommandSupported } from './expoUpdates';

export async function resolveRuntimeVersionAsync({
exp,
platform,
workflow,
projectDir,
logger,
expoUpdatesPackageVersion,
}: {
exp: ExpoConfig;
platform: 'ios' | 'android';
workflow: Workflow;
projectDir: string;
logger: bunyan;
expoUpdatesPackageVersion: string;
Expand All @@ -32,7 +35,7 @@ export async function resolveRuntimeVersionAsync({

const resolvedRuntimeVersionJSONResult = await expoUpdatesCommandAsync(
projectDir,
['runtimeversion:resolve', '--platform', platform, ...extraArgs],
['runtimeversion:resolve', '--platform', platform, '--workflow', workflow, ...extraArgs],
{
logger,
}
Expand Down
1 change: 1 addition & 0 deletions packages/eas-build-job/src/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export namespace Generic {
builderEnvironment: BuilderEnvironmentSchemaZ,
// We use this to discern between Android.Job, Ios.Job and Generic.Job.
platform: z.never().optional(),
type: z.never().optional(),
triggeredBy: z.literal(BuildTrigger.GIT_BASED_INTEGRATION),
loggerLevel: z.nativeEnum(LoggerLevel).optional(),
});
Expand Down