From be6a7f54f959ff32ef099f9e2cb2fbeda71e504c Mon Sep 17 00:00:00 2001 From: jkh Date: Mon, 21 Jun 2021 10:29:31 -0700 Subject: [PATCH] [eas-cli][eas-json] add updates.channel to build metadata (#461) --- CHANGELOG.md | 1 + packages/eas-cli/graphql.schema.json | 53 ++++++++- .../src/build/android/UpdatesModule.ts | 55 +++++---- .../android/__tests__/UpdatesModule-test.ts | 108 ++++++++++++++++++ packages/eas-cli/src/build/android/graphql.ts | 2 + .../eas-cli/src/build/android/prepareJob.ts | 2 + .../eas-cli/src/build/ios/UpdatesModule.ts | 10 ++ .../build/ios/__tests__/UpdatesModule-test.ts | 88 ++++++++++++++ packages/eas-cli/src/build/ios/graphql.ts | 2 + packages/eas-cli/src/build/ios/prepareJob.ts | 3 +- packages/eas-cli/src/build/metadata.ts | 65 ++++++++--- packages/eas-cli/src/graphql/generated.ts | 10 +- packages/eas-json/src/Config.types.ts | 4 + packages/eas-json/src/EasJsonSchema.ts | 4 + yarn.lock | 7 ++ 15 files changed, 366 insertions(+), 48 deletions(-) create mode 100644 packages/eas-cli/src/build/android/__tests__/UpdatesModule-test.ts create mode 100644 packages/eas-cli/src/build/ios/__tests__/UpdatesModule-test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index f0fba5a3c4..e67a955aeb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This is the log of notable changes to EAS CLI and related packages. - Add Big Sur image for iOS builds. ([#457](https://github.com/expo/eas-cli/pull/457) by [@wkozyra95](https://github.com/wkozyra95)) - New version of Android credentials manager ([#460](https://github.com/expo/eas-cli/pull/460) by [@quinlanj](https://github.com/quinlanj)) - Add an internal distribution with dev client to `build:configure` defaults. ([#465](https://github.com/expo/eas-cli/pull/465) by [@fson](https://github.com/fson)) +- Add `updates.channel` to build metadata. ([#461](https://github.com/expo/eas-cli/pull/461) by [@jkhales](https://github.com/jkhales)) ### 🐛 Bug fixes diff --git a/packages/eas-cli/graphql.schema.json b/packages/eas-cli/graphql.schema.json index 60cd9f8de0..24d7ec074c 100644 --- a/packages/eas-cli/graphql.schema.json +++ b/packages/eas-cli/graphql.schema.json @@ -15644,11 +15644,11 @@ "defaultValue": null }, { - "name": "channel", + "name": "updates", "description": "", "type": { - "kind": "SCALAR", - "name": "String", + "kind": "INPUT_OBJECT", + "name": "BuildUpdatesInput", "ofType": null }, "defaultValue": null @@ -15776,6 +15776,27 @@ ], "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "BuildUpdatesInput", + "description": "", + "fields": null, + "inputFields": [ + { + "name": "channel", + "description": "", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "INPUT_OBJECT", "name": "AndroidJobSecretsInput", @@ -16387,6 +16408,16 @@ }, "defaultValue": null }, + { + "name": "updates", + "description": "", + "type": { + "kind": "INPUT_OBJECT", + "name": "BuildUpdatesInput", + "ofType": null + }, + "defaultValue": null + }, { "name": "secrets", "description": "", @@ -16516,11 +16547,11 @@ "defaultValue": null }, { - "name": "channel", + "name": "updates", "description": "", "type": { - "kind": "SCALAR", - "name": "String", + "kind": "INPUT_OBJECT", + "name": "BuildUpdatesInput", "ofType": null }, "defaultValue": null @@ -16899,6 +16930,16 @@ }, "defaultValue": null }, + { + "name": "updates", + "description": "", + "type": { + "kind": "INPUT_OBJECT", + "name": "BuildUpdatesInput", + "ofType": null + }, + "defaultValue": null + }, { "name": "distribution", "description": "", diff --git a/packages/eas-cli/src/build/android/UpdatesModule.ts b/packages/eas-cli/src/build/android/UpdatesModule.ts index 14fce35ab8..9bb41cff56 100644 --- a/packages/eas-cli/src/build/android/UpdatesModule.ts +++ b/packages/eas-cli/src/build/android/UpdatesModule.ts @@ -1,5 +1,5 @@ import { ExpoConfig } from '@expo/config'; -import { AndroidConfig } from '@expo/config-plugins'; +import { AndroidConfig, AndroidManifest } from '@expo/config-plugins'; import fs from 'fs-extra'; import Log from '../../log'; @@ -22,12 +22,7 @@ export async function configureUpdatesAsync(projectDir: string, exp: ExpoConfig) } const androidManifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(projectDir); - if (!androidManifestPath) { - throw new Error(`Could not find AndroidManifest.xml in project directory: "${projectDir}"`); - } - const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync( - androidManifestPath - ); + const androidManifest = await getAndroidManifestAsync(projectDir); if (!AndroidConfig.Updates.isMainApplicationMetaDataSynced(exp, androidManifest, accountName)) { const result = AndroidConfig.Updates.setUpdatesConfig(exp, androidManifest, accountName); @@ -52,10 +47,7 @@ export async function syncUpdatesConfigurationAsync( } const androidManifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(projectDir); - if (!androidManifestPath) { - throw new Error(`Could not find AndroidManifest.xml in project directory: "${projectDir}"`); - } - let androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync(androidManifestPath); + let androidManifest = await getAndroidManifestAsync(projectDir); if (!AndroidConfig.Updates.areVersionsSynced(exp, androidManifest)) { androidManifest = AndroidConfig.Updates.setVersionsConfig(exp, androidManifest); @@ -78,13 +70,7 @@ async function ensureUpdatesConfiguredAsync(projectDir: string, exp: ExpoConfig) throw new Error(`Missing ${gradleScriptApply} in ${buildGradlePath}`); } - const androidManifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(projectDir); - if (!androidManifestPath) { - throw new Error(`Could not find AndroidManifest.xml in project directory: "${projectDir}"`); - } - const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync( - androidManifestPath - ); + const androidManifest = await getAndroidManifestAsync(projectDir); if (!AndroidConfig.Updates.isMainApplicationMetaDataSet(androidManifest)) { throw new Error('Missing values in AndroidManifest.xml'); @@ -93,13 +79,7 @@ async function ensureUpdatesConfiguredAsync(projectDir: string, exp: ExpoConfig) export async function readReleaseChannelSafelyAsync(projectDir: string): Promise { try { - const androidManifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(projectDir); - if (!androidManifestPath) { - throw new Error(`Could not find AndroidManifest.xml in project directory: "${projectDir}"`); - } - const androidManifest = await AndroidConfig.Manifest.readAndroidManifestAsync( - androidManifestPath - ); + const androidManifest = await getAndroidManifestAsync(projectDir); return AndroidConfig.Manifest.getMainApplicationMetaDataValue( androidManifest, AndroidConfig.Updates.Config.RELEASE_CHANNEL @@ -108,3 +88,28 @@ export async function readReleaseChannelSafelyAsync(projectDir: string): Promise return null; } } + +export async function readChannelSafelyAsync(projectDir: string): Promise { + try { + const androidManifest = await getAndroidManifestAsync(projectDir); + const stringifiedRequestHeaders = AndroidConfig.Manifest.getMainApplicationMetaDataValue( + androidManifest, + 'expo.modules.updates.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY' //TODO-JJ AndroidConfig.Updates.Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY once https://github.com/expo/expo-cli/pull/3571 is published + ); + if (!stringifiedRequestHeaders) { + return null; + } + return JSON.parse(stringifiedRequestHeaders)['expo-channel-name'] ?? null; + } catch (err) { + console.log({ err }); + return null; + } +} + +async function getAndroidManifestAsync(projectDir: string): Promise { + const androidManifestPath = await AndroidConfig.Paths.getAndroidManifestAsync(projectDir); + if (!androidManifestPath) { + throw new Error(`Could not find AndroidManifest.xml in project directory: "${projectDir}"`); + } + return AndroidConfig.Manifest.readAndroidManifestAsync(androidManifestPath); +} diff --git a/packages/eas-cli/src/build/android/__tests__/UpdatesModule-test.ts b/packages/eas-cli/src/build/android/__tests__/UpdatesModule-test.ts new file mode 100644 index 0000000000..baddea0d47 --- /dev/null +++ b/packages/eas-cli/src/build/android/__tests__/UpdatesModule-test.ts @@ -0,0 +1,108 @@ +import fs from 'fs-extra'; +import { vol } from 'memfs'; +import os from 'os'; + +import { readChannelSafelyAsync } from '../UpdatesModule'; + +jest.mock('fs'); + +afterAll(() => { + // do not remove the following line + // this fixes a weird error with tempy in @expo/image-utils + fs.removeSync(os.tmpdir()); +}); + +beforeEach(() => { + vol.reset(); + // do not remove the following line + // this fixes a weird error with tempy in @expo/image-utils + fs.mkdirpSync(os.tmpdir()); +}); + +const testChannel = 'test-channel'; +describe(readChannelSafelyAsync, () => { + it('retrieves the channel when it is defined natively', async () => { + vol.fromJSON( + { + './android/app/src/main/AndroidManifest.xml': AndroidManifestWithChannel, + }, + '/expo-project' + ); + const channel = await readChannelSafelyAsync('/expo-project'); + expect(channel).toBe(testChannel); + }); + it('returns null if the channel is not defined natively', async () => { + vol.fromJSON( + { + './android/app/src/main/AndroidManifest.xml': AndroidManifestNoChannel, + }, + '/expo-project' + ); + const channel = await readChannelSafelyAsync('/expo-project'); + expect(channel).toBeNull(); + }); +}); + +const AndroidManifestWithChannel = ` + + + + + + + + + + + + + + + + + + +`; +const AndroidManifestNoChannel = ` + + + + + + + + + + + + + + + + + +`; diff --git a/packages/eas-cli/src/build/android/graphql.ts b/packages/eas-cli/src/build/android/graphql.ts index f9ed147854..0a44ee2a4d 100644 --- a/packages/eas-cli/src/build/android/graphql.ts +++ b/packages/eas-cli/src/build/android/graphql.ts @@ -12,6 +12,7 @@ export function transformGenericJob(job: Android.GenericJob): AndroidGenericJobI projectArchive: transformProjectArchive(job.projectArchive), projectRootDirectory: job.projectRootDirectory, releaseChannel: job.releaseChannel, + updates: job.updates, secrets: job.secrets, builderEnvironment: job.builderEnvironment, cache: job.cache, @@ -25,6 +26,7 @@ export function transformManagedJob(job: Android.ManagedJob): AndroidManagedJobI projectArchive: transformProjectArchive(job.projectArchive), projectRootDirectory: job.projectRootDirectory, releaseChannel: job.releaseChannel, + updates: job.updates, secrets: job.secrets, builderEnvironment: job.builderEnvironment, cache: job.cache, diff --git a/packages/eas-cli/src/build/android/prepareJob.ts b/packages/eas-cli/src/build/android/prepareJob.ts index 445775a746..8cae0b17fd 100644 --- a/packages/eas-cli/src/build/android/prepareJob.ts +++ b/packages/eas-cli/src/build/android/prepareJob.ts @@ -93,6 +93,7 @@ async function prepareGenericJobAsync( gradleCommand: buildProfile.gradleCommand, artifactPath: buildProfile.artifactPath, releaseChannel: buildProfile.releaseChannel, + updates: { channel: buildProfile.channel }, projectRootDirectory, }; } @@ -111,6 +112,7 @@ async function prepareManagedJobAsync( username, buildType: buildProfile.buildType, releaseChannel: buildProfile.releaseChannel, + updates: { channel: buildProfile.channel }, projectRootDirectory, }; } diff --git a/packages/eas-cli/src/build/ios/UpdatesModule.ts b/packages/eas-cli/src/build/ios/UpdatesModule.ts index 8e04af8f2a..6805baabed 100644 --- a/packages/eas-cli/src/build/ios/UpdatesModule.ts +++ b/packages/eas-cli/src/build/ios/UpdatesModule.ts @@ -95,3 +95,13 @@ export async function readReleaseChannelSafelyAsync(projectDir: string): Promise return null; } } + +export async function readChannelSafelyAsync(projectDir: string): Promise { + try { + const expoPlist: any = await readExpoPlistAsync(projectDir); // TODO-JJ remove any once IOSConfig.ExpoPlist is updated to include `EXUpdatesRequestHeaders : Record` + const updatesRequestHeaders = expoPlist['EXUpdatesRequestHeaders'] ?? {}; //TODO-JJ 'EXUpdatesRequestHeaders' IosConfig.Updates.Config.UPDATES_CONFIGURATION_REQUEST_HEADERS_KEY once https://github.com/expo/expo-cli/pull/3571 is published + return updatesRequestHeaders['expo-channel-name'] ?? null; + } catch (err) { + return null; + } +} diff --git a/packages/eas-cli/src/build/ios/__tests__/UpdatesModule-test.ts b/packages/eas-cli/src/build/ios/__tests__/UpdatesModule-test.ts new file mode 100644 index 0000000000..35caeae6fa --- /dev/null +++ b/packages/eas-cli/src/build/ios/__tests__/UpdatesModule-test.ts @@ -0,0 +1,88 @@ +import fs from 'fs-extra'; +import { vol } from 'memfs'; +import os from 'os'; + +import { readChannelSafelyAsync } from '../UpdatesModule'; + +jest.mock('fs'); + +afterAll(() => { + // do not remove the following line + // this fixes a weird error with tempy in @expo/image-utils + fs.removeSync(os.tmpdir()); +}); + +beforeEach(() => { + vol.reset(); + // do not remove the following line + // this fixes a weird error with tempy in @expo/image-utils + fs.mkdirpSync(os.tmpdir()); +}); + +const testChannel = 'test-channel'; +describe(readChannelSafelyAsync, () => { + it('retrieves the channel when it is defined natively', async () => { + vol.fromJSON( + { + 'ios/expo-project/Supporting/Expo.plist': ExpoPlistWithChannel, + 'ios/expo-project/AppDelegate.m': '', + }, + '/expo-project' + ); + const channel = await readChannelSafelyAsync('/expo-project'); + expect(channel).toBe(testChannel); + }); + it('returns null if the channel is not defined natively', async () => { + vol.fromJSON( + { + 'ios/expo-project/Supporting/Expo.plist': ExpoPlistWithOutChannel, + 'ios/expo-project/AppDelegate.m': '', + }, + '/expo-project' + ); + const channel = await readChannelSafelyAsync('/expo-project'); + expect(channel).toBeNull(); + }); +}); + +const ExpoPlistWithChannel = ` + + + EXUpdatesCheckOnLaunch + ALWAYS + EXUpdatesEnabled + + EXUpdatesLaunchWaitMs + 0 + EXUpdatesReleaseChannel + default + EXUpdatesSDKVersion + 40.0.0 + EXUpdatesURL + https://exp.host/@user/expo-project + EXUpdatesRequestHeaders + + expo-channel-name + ${testChannel} + + + +`; +const ExpoPlistWithOutChannel = ` + + + EXUpdatesCheckOnLaunch + ALWAYS + EXUpdatesEnabled + + EXUpdatesLaunchWaitMs + 0 + EXUpdatesReleaseChannel + default + EXUpdatesSDKVersion + 40.0.0 + EXUpdatesURL + https://exp.host/@user/expo-project + + +`; diff --git a/packages/eas-cli/src/build/ios/graphql.ts b/packages/eas-cli/src/build/ios/graphql.ts index b5f3be7e3d..16cbbe3b8f 100644 --- a/packages/eas-cli/src/build/ios/graphql.ts +++ b/packages/eas-cli/src/build/ios/graphql.ts @@ -15,6 +15,7 @@ export function transformGenericJob(job: Ios.GenericJob): IosGenericJobInput { projectArchive: transformProjectArchive(job.projectArchive), projectRootDirectory: job.projectRootDirectory, releaseChannel: job.releaseChannel, + updates: job.updates, distribution: job.distribution && transformDistributionType(job.distribution), secrets: transformIosSecrets(job.secrets), builderEnvironment: job.builderEnvironment, @@ -30,6 +31,7 @@ export function transformManagedJob(job: Ios.ManagedJob): IosManagedJobInput { projectArchive: transformProjectArchive(job.projectArchive), projectRootDirectory: job.projectRootDirectory, releaseChannel: job.releaseChannel, + updates: job.updates, distribution: job.distribution && transformDistributionType(job.distribution), secrets: transformIosSecrets(job.secrets), builderEnvironment: job.builderEnvironment, diff --git a/packages/eas-cli/src/build/ios/prepareJob.ts b/packages/eas-cli/src/build/ios/prepareJob.ts index 465230d6a2..9ff6842772 100644 --- a/packages/eas-cli/src/build/ios/prepareJob.ts +++ b/packages/eas-cli/src/build/ios/prepareJob.ts @@ -34,7 +34,6 @@ interface CommonJobProperties { platform: Platform.IOS; projectArchive: ArchiveSource; builderEnvironment: Ios.BuilderEnvironment; - releaseChannel?: string; distribution?: Ios.DistributionType; cache: Cache; secrets: { @@ -106,6 +105,7 @@ async function prepareGenericJobAsync( buildConfiguration: buildProfile.schemeBuildConfiguration, artifactPath: buildProfile.artifactPath, releaseChannel: buildProfile.releaseChannel, + updates: { channel: buildProfile.channel }, projectRootDirectory, }; } @@ -127,6 +127,7 @@ async function prepareManagedJobAsync( buildType: buildProfile.buildType, username, releaseChannel: buildProfile.releaseChannel, + updates: { channel: buildProfile.channel }, projectRootDirectory, }; } diff --git a/packages/eas-cli/src/build/metadata.ts b/packages/eas-cli/src/build/metadata.ts index 2a9976c309..866455b0ab 100644 --- a/packages/eas-cli/src/build/metadata.ts +++ b/packages/eas-cli/src/build/metadata.ts @@ -6,10 +6,16 @@ import { getBundleIdentifier } from '../project/ios/bundleIdentifier'; import { getUsername } from '../project/projectUtils'; import { ensureLoggedInAsync } from '../user/actions'; import { gitCommitHashAsync } from '../utils/git'; -import { readReleaseChannelSafelyAsync as readAndroidReleaseChannelSafelyAsync } from './android/UpdatesModule'; +import { + readChannelSafelyAsync as readAndroidChannelSafelyAsync, + readReleaseChannelSafelyAsync as readAndroidReleaseChannelSafelyAsync, +} from './android/UpdatesModule'; import { readVersionCode, readVersionName } from './android/version'; import { BuildContext } from './context'; -import { readReleaseChannelSafelyAsync as readIosReleaseChannelSafelyAsync } from './ios/UpdatesModule'; +import { + readChannelSafelyAsync as readIosChannelSafelyAsync, + readReleaseChannelSafelyAsync as readIosReleaseChannelSafelyAsync, +} from './ios/UpdatesModule'; import { readBuildNumberAsync, readShortVersionAsync } from './ios/version'; import { Platform } from './types'; import { isExpoUpdatesInstalled } from './utils/updates'; @@ -29,6 +35,7 @@ export async function collectMetadata( credentialsSource?: CredentialsSource.LOCAL | CredentialsSource.REMOTE; } ): Promise { + const channelOrReleaseChannel = await resolveChannelOrReleaseChannelAsync(ctx); return { // TODO: type error fixed in https://github.com/expo/eas-build/pull/34 // remove @ts-expect-error after upgrading @expo/eas-build-job @@ -40,7 +47,7 @@ export async function collectMetadata( workflow: ctx.buildProfile.workflow, credentialsSource, sdkVersion: ctx.commandCtx.exp.sdkVersion, - releaseChannel: await resolveReleaseChannel(ctx), + ...channelOrReleaseChannel, distribution: ctx.buildProfile.distribution ?? 'store', appName: ctx.commandCtx.exp.name, appIdentifier: resolveAppIdentifier(ctx), @@ -79,22 +86,52 @@ function resolveAppIdentifier(ctx: BuildContext): string } } -async function resolveReleaseChannel( +async function resolveChannelOrReleaseChannelAsync( ctx: BuildContext -): Promise { +): Promise<{ channel: string } | { releaseChannel: string } | null> { if (!isExpoUpdatesInstalled(ctx.commandCtx.projectDir)) { - return undefined; + return null; + } + if (ctx.buildProfile.channel) { + return { channel: ctx.buildProfile.channel }; } - if (ctx.buildProfile.releaseChannel) { - return ctx.buildProfile.releaseChannel; + return { releaseChannel: ctx.buildProfile.releaseChannel }; + } + const channel = await getNativeChannelAsync(ctx); + if (channel) { + return { channel }; } + const releaseChannel = await getNativeReleaseChannelAsync(ctx); + return { releaseChannel }; +} - let maybeReleaseChannel: string | null; - if (ctx.platform === Platform.ANDROID) { - maybeReleaseChannel = await readAndroidReleaseChannelSafelyAsync(ctx.commandCtx.projectDir); - } else { - maybeReleaseChannel = await readIosReleaseChannelSafelyAsync(ctx.commandCtx.projectDir); +async function getNativeReleaseChannelAsync( + ctx: BuildContext +): Promise { + switch (ctx.platform) { + case Platform.ANDROID: { + return (await readAndroidReleaseChannelSafelyAsync(ctx.commandCtx.projectDir)) ?? 'default'; + } + case Platform.IOS: { + return (await readIosReleaseChannelSafelyAsync(ctx.commandCtx.projectDir)) ?? 'default'; + } + default: + return 'default'; } - return maybeReleaseChannel ?? 'default'; +} + +async function getNativeChannelAsync( + ctx: BuildContext +): Promise { + switch (ctx.platform) { + case Platform.ANDROID: { + return (await readAndroidChannelSafelyAsync(ctx.commandCtx.projectDir)) ?? undefined; + } + case Platform.IOS: { + return (await readIosChannelSafelyAsync(ctx.commandCtx.projectDir)) ?? undefined; + } + } + + return undefined; } diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index 0faa116611..3b30c18ba8 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -2402,7 +2402,7 @@ export type AndroidGenericJobInput = { projectArchive: ProjectArchiveSourceInput; projectRootDirectory: Scalars['String']; releaseChannel?: Maybe; - channel?: Maybe; + updates?: Maybe; secrets?: Maybe; builderEnvironment?: Maybe; cache?: Maybe; @@ -2421,6 +2421,10 @@ export enum ProjectArchiveSourceType { Url = 'URL' } +export type BuildUpdatesInput = { + channel?: Maybe; +}; + export type AndroidJobSecretsInput = { buildCredentials?: Maybe; environmentSecrets?: Maybe; @@ -2503,6 +2507,7 @@ export type AndroidManagedJobInput = { projectArchive: ProjectArchiveSourceInput; projectRootDirectory: Scalars['String']; releaseChannel?: Maybe; + updates?: Maybe; secrets?: Maybe; builderEnvironment?: Maybe; cache?: Maybe; @@ -2520,7 +2525,7 @@ export type IosGenericJobInput = { projectArchive: ProjectArchiveSourceInput; projectRootDirectory: Scalars['String']; releaseChannel?: Maybe; - channel?: Maybe; + updates?: Maybe; distribution?: Maybe; secrets?: Maybe; builderEnvironment?: Maybe; @@ -2567,6 +2572,7 @@ export type IosManagedJobInput = { projectArchive: ProjectArchiveSourceInput; projectRootDirectory: Scalars['String']; releaseChannel?: Maybe; + updates?: Maybe; distribution?: Maybe; secrets?: Maybe; builderEnvironment?: Maybe; diff --git a/packages/eas-json/src/Config.types.ts b/packages/eas-json/src/Config.types.ts index bca56f1a3e..7b783d25dd 100644 --- a/packages/eas-json/src/Config.types.ts +++ b/packages/eas-json/src/Config.types.ts @@ -18,6 +18,7 @@ export interface AndroidManagedBuildProfile extends Android.BuilderEnvironment { credentialsSource: CredentialsSource; buildType?: Android.ManagedBuildType; releaseChannel?: string; + channel?: string; distribution: AndroidDistributionType; cache: Cache; } @@ -27,6 +28,7 @@ export interface AndroidGenericBuildProfile extends Android.BuilderEnvironment { credentialsSource: CredentialsSource; gradleCommand?: string; releaseChannel?: string; + channel?: string; artifactPath?: string; withoutCredentials?: boolean; distribution: AndroidDistributionType; @@ -38,6 +40,7 @@ export interface IosManagedBuildProfile extends Ios.BuilderEnvironment { credentialsSource: CredentialsSource; buildType?: Ios.ManagedBuildType; releaseChannel?: string; + channel?: string; distribution: IosDistributionType; enterpriseProvisioning?: IosEnterpriseProvisioning; autoIncrement: VersionAutoIncrement; @@ -50,6 +53,7 @@ export interface IosGenericBuildProfile extends Ios.BuilderEnvironment { scheme?: string; schemeBuildConfiguration?: string; releaseChannel?: string; + channel?: string; artifactPath?: string; distribution: IosDistributionType; enterpriseProvisioning?: IosEnterpriseProvisioning; diff --git a/packages/eas-json/src/EasJsonSchema.ts b/packages/eas-json/src/EasJsonSchema.ts index ad100d1ac5..465034e6c7 100644 --- a/packages/eas-json/src/EasJsonSchema.ts +++ b/packages/eas-json/src/EasJsonSchema.ts @@ -49,6 +49,7 @@ const AndroidGenericSchema = Joi.object({ otherwise: Joi.string(), }), releaseChannel: Joi.string(), + channel: Joi.string(), artifactPath: Joi.string(), withoutCredentials: Joi.boolean().default(false), distribution: Joi.string().valid('store', 'internal').default('store'), @@ -59,6 +60,7 @@ const AndroidManagedSchema = Joi.object({ workflow: Joi.string().valid('managed').required(), credentialsSource: Joi.string().valid('local', 'remote').default('remote'), releaseChannel: Joi.string(), + channel: Joi.string(), buildType: Joi.alternatives().conditional('distribution', { is: 'internal', then: Joi.string().valid('apk', 'development-client').default('apk'), @@ -74,6 +76,7 @@ const IosGenericSchema = Joi.object({ scheme: Joi.string(), schemeBuildConfiguration: Joi.string(), releaseChannel: Joi.string(), + channel: Joi.string(), artifactPath: Joi.string(), distribution: Joi.string().valid('store', 'internal', 'simulator').default('store'), enterpriseProvisioning: Joi.string().valid('adhoc', 'universal'), @@ -88,6 +91,7 @@ const IosManagedSchema = Joi.object({ credentialsSource: Joi.string().valid('local', 'remote').default('remote'), buildType: Joi.string().valid('release', 'development-client').default('release'), releaseChannel: Joi.string(), + channel: Joi.string(), distribution: Joi.string().valid('store', 'internal', 'simulator').default('store'), enterpriseProvisioning: Joi.string().valid('adhoc', 'universal'), autoIncrement: Joi.alternatives() diff --git a/yarn.lock b/yarn.lock index 590cafe537..c241537c08 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1924,6 +1924,13 @@ dependencies: "@hapi/joi" "^17.1.1" +"@expo/eas-build-job@0.2.37": + version "0.2.37" + resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-0.2.37.tgz#fd6cb911e33774239d1ab7662c0ccc8efa22f7a2" + integrity sha512-B9gahwTTYs0pWQP2HnfYWcbsqmUIAdnr+iwounVqpcxHhERxGJby2JEw+Vxtl2+VMARM4w9RLgNduP5Vk/zeQw== + dependencies: + "@hapi/joi" "^17.1.1" + "@expo/image-utils@0.3.14": version "0.3.14" resolved "https://registry.yarnpkg.com/@expo/image-utils/-/image-utils-0.3.14.tgz#eea0d59c5845e8b19504011c20afd837c5d044c5"