Skip to content

Commit

Permalink
Use proper buildMode in proper place
Browse files Browse the repository at this point in the history
  • Loading branch information
sjchmiela committed Nov 28, 2023
1 parent e5effdd commit e34f030
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
13 changes: 6 additions & 7 deletions packages/eas-cli/src/build/graphql.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ArchiveSource,
ArchiveSourceType,
BuildMode,
BuildTrigger,
Metadata,
Workflow,
Expand All @@ -10,9 +11,9 @@ import {
BuildCredentialsSource,
BuildIosEnterpriseProvisioning,
BuildMetadataInput,
BuildMode,
BuildWorkflow,
DistributionType,
BuildMode as GraphQLBuildMode,
BuildTrigger as GraphQLBuildTrigger,
ProjectArchiveSourceInput,
ProjectArchiveSourceType,
Expand Down Expand Up @@ -42,7 +43,6 @@ export function transformProjectArchive(archiveSource: ArchiveSource): ProjectAr
export function transformMetadata(metadata: Metadata): BuildMetadataInput {
return {
...metadata,
buildMode: metadata.buildMode && transformBuildMode(metadata.buildMode),
credentialsSource:
metadata.credentialsSource && transformCredentialsSource(metadata.credentialsSource),
distribution: metadata.distribution && transformDistribution(metadata.distribution),
Expand Down Expand Up @@ -91,14 +91,13 @@ export function transformIosEnterpriseProvisioning(
}
}

// TODO: check what in metadata
export function transformBuildMode(buildMode: string): BuildMode {
export function transformBuildMode(buildMode: BuildMode): GraphQLBuildMode {
if (buildMode === 'build') {
return BuildMode.Build;
return GraphQLBuildMode.Build;
} else if (buildMode === 'resign') {
return BuildMode.Resign;
return GraphQLBuildMode.Resign;
} else if (buildMode === 'custom') {
return BuildMode.Custom;
return GraphQLBuildMode.Custom;
} else {
throw new Error(`Unsupported build mode: ${buildMode}`);
}
Expand Down
3 changes: 1 addition & 2 deletions packages/eas-cli/src/build/metadata.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Updates } from '@expo/config-plugins';
import { BuildMode, Metadata, Platform, sanitizeMetadata } from '@expo/eas-build-job';
import { Metadata, Platform, sanitizeMetadata } from '@expo/eas-build-job';
import { IosEnterpriseProvisioning } from '@expo/eas-json';
import fs from 'fs-extra';
import resolveFrom from 'resolve-from';
Expand Down Expand Up @@ -59,7 +59,6 @@ export async function collectMetadataAsync<T extends Platform>(
}),
runWithNoWaitFlag: ctx.noWait,
runFromCI: ctx.runFromCI,
buildMode: ctx.buildProfile.config ? BuildMode.CUSTOM : BuildMode.BUILD,
customWorkflowName: ctx.customBuildConfigMetadata?.workflowName,
developmentClient: ctx.developmentClient,
requiredPackageManager: ctx.requiredPackageManager ?? undefined,
Expand Down

0 comments on commit e34f030

Please sign in to comment.