diff --git a/packages/eas-cli/src/build/android/prepareJob.ts b/packages/eas-cli/src/build/android/prepareJob.ts index 760da2d615..6ba375304b 100644 --- a/packages/eas-cli/src/build/android/prepareJob.ts +++ b/packages/eas-cli/src/build/android/prepareJob.ts @@ -93,13 +93,18 @@ export async function prepareJobAsync( experimental: { prebuildCommand: buildProfile.prebuildCommand, }, - mode: buildProfile.config ? BuildMode.CUSTOM : BuildMode.BUILD, + mode: buildProfile.config || ctx.repack ? BuildMode.CUSTOM : BuildMode.BUILD, triggeredBy: BuildTrigger.EAS_CLI, ...(maybeCustomBuildConfigPath && { customBuildConfig: { path: maybeCustomBuildConfigPath, }, }), + ...(ctx.repack && { + customBuildConfig: { + path: '__eas/repack.yml', + }, + }), loggerLevel: ctx.loggerLevel, }; diff --git a/packages/eas-cli/src/build/context.ts b/packages/eas-cli/src/build/context.ts index 515aae587a..eee33464e2 100644 --- a/packages/eas-cli/src/build/context.ts +++ b/packages/eas-cli/src/build/context.ts @@ -62,4 +62,5 @@ export interface BuildContext { requiredPackageManager: NodePackageManager['name'] | null; vcsClient: Client; loggerLevel?: LoggerLevel; + repack: boolean; } diff --git a/packages/eas-cli/src/build/createContext.ts b/packages/eas-cli/src/build/createContext.ts index 9471fe9206..ab8fbf21a3 100644 --- a/packages/eas-cli/src/build/createContext.ts +++ b/packages/eas-cli/src/build/createContext.ts @@ -42,6 +42,7 @@ export async function createBuildContextAsync({ customBuildConfigMetadata, buildLoggerLevel, freezeCredentials, + repack, }: { buildProfileName: string; buildProfile: BuildProfile; @@ -62,6 +63,7 @@ export async function createBuildContextAsync({ customBuildConfigMetadata?: CustomBuildConfigMetadata; buildLoggerLevel?: LoggerLevel; freezeCredentials: boolean; + repack: boolean; }): Promise> { const { exp, projectId } = await getDynamicPrivateProjectConfigAsync({ env: buildProfile.env }); const projectName = exp.slug; @@ -143,6 +145,7 @@ export async function createBuildContextAsync({ developmentClient, requiredPackageManager, loggerLevel: buildLoggerLevel, + repack, }; if (platform === Platform.ANDROID) { const common = commonContext as CommonContext; diff --git a/packages/eas-cli/src/build/ios/prepareJob.ts b/packages/eas-cli/src/build/ios/prepareJob.ts index e14639d36e..1da13a2dff 100644 --- a/packages/eas-cli/src/build/ios/prepareJob.ts +++ b/packages/eas-cli/src/build/ios/prepareJob.ts @@ -88,13 +88,18 @@ export async function prepareJobAsync( experimental: { prebuildCommand: buildProfile.prebuildCommand, }, - mode: buildProfile.config ? BuildMode.CUSTOM : BuildMode.BUILD, + mode: buildProfile.config || ctx.repack ? BuildMode.CUSTOM : BuildMode.BUILD, triggeredBy: BuildTrigger.EAS_CLI, ...(maybeCustomBuildConfigPath && { customBuildConfig: { path: maybeCustomBuildConfigPath, }, }), + ...(ctx.repack && { + customBuildConfig: { + path: '__eas/repack.yml', + }, + }), loggerLevel: ctx.loggerLevel, }; return sanitizeBuildJob(job) as Ios.Job; diff --git a/packages/eas-cli/src/build/runBuildAndSubmit.ts b/packages/eas-cli/src/build/runBuildAndSubmit.ts index e92a702298..3721668276 100644 --- a/packages/eas-cli/src/build/runBuildAndSubmit.ts +++ b/packages/eas-cli/src/build/runBuildAndSubmit.ts @@ -95,6 +95,7 @@ export interface BuildFlags { message?: string; buildLoggerLevel?: LoggerLevel; freezeCredentials: boolean; + repack: boolean; } export async function runBuildAndSubmitAsync( @@ -375,6 +376,7 @@ async function prepareAndStartBuildAsync({ customBuildConfigMetadata, buildLoggerLevel: flags.buildLoggerLevel, freezeCredentials: flags.freezeCredentials, + repack: flags.repack, }); if (moreBuilds) { diff --git a/packages/eas-cli/src/commands/build/index.ts b/packages/eas-cli/src/commands/build/index.ts index 2ea44a4bfe..eefefc0253 100644 --- a/packages/eas-cli/src/commands/build/index.ts +++ b/packages/eas-cli/src/commands/build/index.ts @@ -36,6 +36,7 @@ interface RawBuildFlags { message?: string; 'build-logger-level'?: LoggerLevel; 'freeze-credentials': boolean; + repack: boolean; } export default class Build extends EasCommand { @@ -109,6 +110,11 @@ export default class Build extends EasCommand { default: false, description: 'Prevent the build from updating credentials in non-interactive mode', }), + repack: Flags.boolean({ + default: false, + hidden: true, + description: 'Use the golden dev client build repack flow as it works for onboarding', + }), ...EasNonInteractiveAndJsonFlags, }; @@ -223,6 +229,7 @@ export default class Build extends EasCommand { message, buildLoggerLevel: flags['build-logger-level'], freezeCredentials: flags['freeze-credentials'], + repack: flags.repack, }; } diff --git a/packages/eas-cli/src/commands/build/inspect.ts b/packages/eas-cli/src/commands/build/inspect.ts index fe6f1cd432..42213bb61b 100644 --- a/packages/eas-cli/src/commands/build/inspect.ts +++ b/packages/eas-cli/src/commands/build/inspect.ts @@ -120,6 +120,7 @@ export default class BuildInspect extends EasCommand { workingdir: tmpWorkingdir, artifactsDir: path.join(tmpWorkingdir, 'artifacts'), }, + repack: false, }, actor, getDynamicPrivateProjectConfigAsync diff --git a/packages/eas-cli/src/commands/build/internal.ts b/packages/eas-cli/src/commands/build/internal.ts index 85427854f2..9aac620f86 100644 --- a/packages/eas-cli/src/commands/build/internal.ts +++ b/packages/eas-cli/src/commands/build/internal.ts @@ -86,6 +86,7 @@ export default class BuildInternal extends EasCommand { localBuildMode: LocalBuildMode.INTERNAL, }, submitProfile: flags['auto-submit-with-profile'] ?? flags.profile, + repack: false, }, actor, getDynamicPrivateProjectConfigAsync diff --git a/packages/eas-cli/src/commands/project/onboarding.ts b/packages/eas-cli/src/commands/project/onboarding.ts index 3e9e588661..0cd1280f14 100644 --- a/packages/eas-cli/src/commands/project/onboarding.ts +++ b/packages/eas-cli/src/commands/project/onboarding.ts @@ -291,6 +291,7 @@ export default class Onboarding extends EasCommand { autoSubmit: false, localBuildOptions: {}, freezeCredentials: false, + repack: true, }, actor, getDynamicProjectConfigFn