diff --git a/packages/eas-cli/src/build/android/graphql.ts b/packages/eas-cli/src/build/android/graphql.ts index 67b644e380..0dceafa5e1 100644 --- a/packages/eas-cli/src/build/android/graphql.ts +++ b/packages/eas-cli/src/build/android/graphql.ts @@ -8,6 +8,7 @@ import { transformProjectArchive, transformWorkflow, } from '../graphql'; +import { buildProfileEnvironmentToEnvironment } from '../utils/environment'; export function transformJob(job: Android.Job): AndroidJobInput { return { @@ -29,6 +30,7 @@ export function transformJob(job: Android.Job): AndroidJobInput { experimental: job.experimental, mode: transformBuildMode(job.mode), customBuildConfig: job.customBuildConfig, + environment: buildProfileEnvironmentToEnvironment(job.environment), loggerLevel: job.loggerLevel ? loggerLevelToGraphQLWorkerLoggerLevel[job.loggerLevel] : undefined, diff --git a/packages/eas-cli/src/build/android/prepareJob.ts b/packages/eas-cli/src/build/android/prepareJob.ts index 9109b8632e..00023b78b0 100644 --- a/packages/eas-cli/src/build/android/prepareJob.ts +++ b/packages/eas-cli/src/build/android/prepareJob.ts @@ -92,6 +92,7 @@ export async function prepareJobAsync( gradleCommand: buildProfile.gradleCommand, applicationArchivePath: buildProfile.applicationArchivePath ?? buildProfile.artifactPath, buildArtifactPaths: buildProfile.buildArtifactPaths, + environment: ctx.buildProfile.environment, buildType, username, ...(ctx.android.versionCodeOverride && { diff --git a/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts b/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts index 996a08d761..47f4dfc4ad 100644 --- a/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts +++ b/packages/eas-cli/src/build/evaluateConfigWithEnvVarsAsync.ts @@ -1,17 +1,12 @@ import { Env } from '@expo/eas-build-job'; import { BuildProfile } from '@expo/eas-json'; +import { isEnvironment } from './utils/environment'; import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient'; import { EnvironmentVariableEnvironment } from '../graphql/generated'; import { EnvironmentVariablesQuery } from '../graphql/queries/EnvironmentVariablesQuery'; import Log, { learnMore } from '../log'; -function isEnvironment(env: string): env is EnvironmentVariableEnvironment { - return Object.values(EnvironmentVariableEnvironment).includes( - env as EnvironmentVariableEnvironment - ); -} - export async function evaluateConfigWithEnvVarsAsync({ buildProfile, buildProfileName, diff --git a/packages/eas-cli/src/build/ios/graphql.ts b/packages/eas-cli/src/build/ios/graphql.ts index a143363a8b..6cc958168e 100644 --- a/packages/eas-cli/src/build/ios/graphql.ts +++ b/packages/eas-cli/src/build/ios/graphql.ts @@ -9,6 +9,7 @@ import { transformProjectArchive, transformWorkflow, } from '../graphql'; +import { buildProfileEnvironmentToEnvironment } from '../utils/environment'; export function transformJob(job: Ios.Job): IosJobInput { return { @@ -31,6 +32,7 @@ export function transformJob(job: Ios.Job): IosJobInput { experimental: job.experimental, mode: transformBuildMode(job.mode), customBuildConfig: job.customBuildConfig, + environment: buildProfileEnvironmentToEnvironment(job.environment), loggerLevel: job.loggerLevel ? loggerLevelToGraphQLWorkerLoggerLevel[job.loggerLevel] : undefined, diff --git a/packages/eas-cli/src/build/ios/prepareJob.ts b/packages/eas-cli/src/build/ios/prepareJob.ts index 8451d1adbf..d2a6a11d05 100644 --- a/packages/eas-cli/src/build/ios/prepareJob.ts +++ b/packages/eas-cli/src/build/ios/prepareJob.ts @@ -88,6 +88,7 @@ export async function prepareJobAsync( buildConfiguration: buildProfile.buildConfiguration, applicationArchivePath: buildProfile.applicationArchivePath ?? buildProfile.artifactPath, buildArtifactPaths: buildProfile.buildArtifactPaths, + environment: ctx.buildProfile.environment, username, ...(ctx.ios.buildNumberOverride && { version: { diff --git a/packages/eas-cli/src/build/metadata.ts b/packages/eas-cli/src/build/metadata.ts index 0cde2393f6..8d3cbe4420 100644 --- a/packages/eas-cli/src/build/metadata.ts +++ b/packages/eas-cli/src/build/metadata.ts @@ -62,7 +62,6 @@ export async function collectMetadataAsync( requiredPackageManager: ctx.requiredPackageManager ?? undefined, selectedImage: ctx.buildProfile.image, customNodeVersion: ctx.buildProfile.node, - environment: ctx.buildProfile.environment, simulator: 'simulator' in ctx.buildProfile && ctx.buildProfile.simulator, }; return sanitizeMetadata(metadata); diff --git a/packages/eas-cli/src/build/utils/environment.ts b/packages/eas-cli/src/build/utils/environment.ts new file mode 100644 index 0000000000..e1cc7068bf --- /dev/null +++ b/packages/eas-cli/src/build/utils/environment.ts @@ -0,0 +1,26 @@ +import { BuildProfile } from '@expo/eas-json'; + +import { EnvironmentVariableEnvironment } from '../../graphql/generated'; + +type Environment = NonNullable; + +const BuildProfileEnvironmentToEnvironment: Record = { + production: EnvironmentVariableEnvironment.Production, + preview: EnvironmentVariableEnvironment.Preview, + development: EnvironmentVariableEnvironment.Development, +}; + +export function isEnvironment(env: string): env is EnvironmentVariableEnvironment { + return Object.values(EnvironmentVariableEnvironment).includes( + env as EnvironmentVariableEnvironment + ); +} + +export function buildProfileEnvironmentToEnvironment( + environment: BuildProfile['environment'] +): EnvironmentVariableEnvironment | null { + if (!environment) { + return null; + } + return BuildProfileEnvironmentToEnvironment[environment]; +} diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index bad0aa7ad4..59cf5ef673 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -1090,6 +1090,7 @@ export type AndroidJobInput = { cache?: InputMaybe; customBuildConfig?: InputMaybe; developmentClient?: InputMaybe; + environment?: InputMaybe; experimental?: InputMaybe; gradleCommand?: InputMaybe; loggerLevel?: InputMaybe; @@ -1601,6 +1602,7 @@ export type AppUpdatesArgs = { export type AppUpdatesPaginatedArgs = { after?: InputMaybe; before?: InputMaybe; + filter?: InputMaybe; first?: InputMaybe; last?: InputMaybe; }; @@ -2902,7 +2904,7 @@ export type BuildArtifacts = { applicationArchiveUrl?: Maybe; buildArtifactsUrl?: Maybe; buildUrl?: Maybe; - /** @deprecated Use 'runtime.fingerprintDebugInfoUrl' instead. */ + /** @deprecated Use 'runtime.fingerprint.debugInfoUrl' instead. */ fingerprintUrl?: Maybe; xcodeBuildLogsUrl?: Maybe; }; @@ -2933,6 +2935,7 @@ export type BuildFilter = { appVersion?: InputMaybe; buildProfile?: InputMaybe; channel?: InputMaybe; + developmentClient?: InputMaybe; distribution?: InputMaybe; fingerprintHash?: InputMaybe; gitCommitHash?: InputMaybe; @@ -4384,6 +4387,7 @@ export enum GitHubAppEnvironment { export type GitHubAppInstallation = { __typename?: 'GitHubAppInstallation'; + /** The Expo account that owns the installation entity. */ account: Account; actor?: Maybe; id: Scalars['ID']['output']; @@ -4403,10 +4407,17 @@ export type GitHubAppInstallationAccessibleRepository = { url: Scalars['String']['output']; }; +export enum GitHubAppInstallationAccountType { + Organization = 'ORGANIZATION', + User = 'USER' +} + export type GitHubAppInstallationMetadata = { __typename?: 'GitHubAppInstallationMetadata'; githubAccountAvatarUrl?: Maybe; + /** The login of the GitHub account that owns the installation. Not the display name. */ githubAccountName?: Maybe; + githubAccountType?: Maybe; installationStatus: GitHubAppInstallationStatus; }; @@ -5050,6 +5061,7 @@ export type IosJobInput = { developmentClient?: InputMaybe; /** @deprecated */ distribution?: InputMaybe; + environment?: InputMaybe; experimental?: InputMaybe; loggerLevel?: InputMaybe; mode?: InputMaybe; @@ -5744,7 +5756,6 @@ export type PublishUpdateGroupInput = { message?: InputMaybe; rollBackToEmbeddedInfoGroup?: InputMaybe; rolloutInfoGroup?: InputMaybe; - runtimeFingerprintSource?: InputMaybe; runtimeVersion: Scalars['String']['input']; turtleJobRunId?: InputMaybe; updateInfoGroup?: InputMaybe; @@ -6182,7 +6193,7 @@ export type Runtime = { builds: AppBuildsConnection; createdAt: Scalars['DateTime']['output']; deployments: DeploymentsConnection; - fingerprintDebugInfoUrl?: Maybe; + fingerprint?: Maybe; firstBuildCreatedAt?: Maybe; id: Scalars['ID']['output']; updatedAt: Scalars['DateTime']['output']; @@ -6984,6 +6995,12 @@ export type UpdateEnvironmentVariableInput = { visibility?: InputMaybe; }; +export type UpdateFilterInput = { + fingerprintHash?: InputMaybe; + hasFingerprint?: InputMaybe; + runtimeVersion?: InputMaybe; +}; + export type UpdateGitHubBuildTriggerInput = { autoSubmit: Scalars['Boolean']['input']; buildProfile: Scalars['String']['input']; @@ -8499,6 +8516,7 @@ export type WorkflowRunMutationCreateWorkflowRunArgs = { export type WorkflowRunMutationRetryWorkflowRunArgs = { + fromFailedJobs?: InputMaybe; workflowRunId: Scalars['ID']['input']; };