From 44dbaaef6659923efb44a0d57004bf3aca897de2 Mon Sep 17 00:00:00 2001 From: Michael Hampton Date: Sat, 8 May 2021 22:39:50 -0400 Subject: [PATCH] [eas-cli] Support buildConfiguration parameter. --- CHANGELOG.md | 1 + packages/eas-cli/graphql.schema.json | 324 +++++++++++++++++- packages/eas-cli/package.json | 2 +- packages/eas-cli/src/build/ios/graphql.ts | 32 +- packages/eas-cli/src/build/ios/prepareJob.ts | 5 +- packages/eas-cli/src/graphql/generated.ts | 44 +++ packages/eas-json/package.json | 4 +- packages/eas-json/src/Config.types.ts | 2 +- packages/eas-json/src/EasJsonSchema.ts | 2 +- .../src/__tests__/EasJsonReader-test.ts | 4 +- yarn.lock | 8 +- 11 files changed, 390 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e044a965..27b45e1f95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This is the log of notable changes to EAS CLI and related packages. - Make eas branch:publish work with expo-cli >= 4.4.3 ([#366](https://github.com/expo/eas-cli/pull/366) by [@jkhales](https://github.com/jkhales)) - Create asset keys without an extension. ([#366](https://github.com/expo/eas-cli/pull/366) by [@jkhales](https://github.com/jkhales)) +- Remove schemeBuildConfiguration in favor of buildConfiguration. ([#394](https://github.com/expo/eas-cli/pull/394) by [@randomhajile](https://github.com/randomhajile)) ### 🎉 New features diff --git a/packages/eas-cli/graphql.schema.json b/packages/eas-cli/graphql.schema.json index 253f1e1dfb..c844865c67 100644 --- a/packages/eas-cli/graphql.schema.json +++ b/packages/eas-cli/graphql.schema.json @@ -896,6 +896,22 @@ }, "isDeprecated": false, "deprecationReason": null + }, + { + "name": "manifestPermalink", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null } ], "inputFields": null, @@ -4489,9 +4505,25 @@ "deprecationReason": null }, { - "name": "accounts", + "name": "primaryAccount", "description": "Associated accounts", "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Account", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "accounts", + "description": "", + "args": [], "type": { "kind": "NON_NULL", "name": null, @@ -6204,6 +6236,30 @@ "isDeprecated": false, "deprecationReason": null }, + { + "name": "androidConfig", + "description": "", + "args": [], + "type": { + "kind": "OBJECT", + "name": "AndroidSubmissionConfig", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "iosConfig", + "description": "", + "args": [], + "type": { + "kind": "OBJECT", + "name": "IosSubmissionConfig", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, { "name": "logsUrl", "description": "", @@ -6272,6 +6328,213 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "OBJECT", + "name": "AndroidSubmissionConfig", + "description": "", + "fields": [ + { + "name": "applicationIdentifier", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "archiveType", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SubmissionAndroidArchiveType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "track", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SubmissionAndroidTrack", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "releaseStatus", + "description": "", + "args": [], + "type": { + "kind": "ENUM", + "name": "SubmissionAndroidReleaseStatus", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SubmissionAndroidArchiveType", + "description": "", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "APK", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AAB", + "description": "", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SubmissionAndroidTrack", + "description": "", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PRODUCTION", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERNAL", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ALPHA", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BETA", + "description": "", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SubmissionAndroidReleaseStatus", + "description": "", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "DRAFT", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "IN_PROGRESS", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HALTED", + "description": "", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMPLETED", + "description": "", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "IosSubmissionConfig", + "description": "", + "fields": [ + { + "name": "ascAppIdentifier", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "appleIdUsername", + "description": "", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "SubmissionError", @@ -8637,6 +8900,16 @@ } }, "defaultValue": null + }, + { + "name": "filter", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "UpdatesFilter", + "ofType": null + }, + "defaultValue": null } ], "type": { @@ -8665,6 +8938,45 @@ "enumValues": null, "possibleTypes": null }, + { + "kind": "INPUT_OBJECT", + "name": "UpdatesFilter", + "description": "", + "fields": null, + "inputFields": [ + { + "name": "platform", + "description": "", + "type": { + "kind": "ENUM", + "name": "AppPlatform", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "runtimeVersions", + "description": "", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, { "kind": "OBJECT", "name": "EnvironmentSecret", @@ -15900,6 +16212,16 @@ }, "defaultValue": null }, + { + "name": "buildConfiguration", + "description": "", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, { "name": "artifactPath", "description": "", diff --git a/packages/eas-cli/package.json b/packages/eas-cli/package.json index 62fc2432cf..c63f302dc8 100644 --- a/packages/eas-cli/package.json +++ b/packages/eas-cli/package.json @@ -13,7 +13,7 @@ "@expo/apple-utils": "0.0.0-alpha.18", "@expo/config": "~3.3.19", "@expo/config-plugins": "1.0.24", - "@expo/eas-build-job": "0.2.28", + "@expo/eas-build-job": "0.2.31", "@expo/eas-json": "^0.13.0", "@expo/json-file": "^8.2.24", "@expo/plist": "^0.0.11", diff --git a/packages/eas-cli/src/build/ios/graphql.ts b/packages/eas-cli/src/build/ios/graphql.ts index e011a05656..651be9b563 100644 --- a/packages/eas-cli/src/build/ios/graphql.ts +++ b/packages/eas-cli/src/build/ios/graphql.ts @@ -7,7 +7,6 @@ import { IosJobSecretsInput, IosManagedBuildType, IosManagedJobInput, - IosSchemeBuildConfiguration, } from '../../graphql/generated'; import { transformProjectArchive } from '../graphql'; @@ -21,9 +20,7 @@ export function transformGenericJob(job: Ios.GenericJob): IosGenericJobInput { builderEnvironment: job.builderEnvironment, cache: job.cache, scheme: job.scheme, - schemeBuildConfiguration: - job.schemeBuildConfiguration && - transformSchemeBuildConfiguration(job.schemeBuildConfiguration), + buildConfiguration: job.buildConfiguration, artifactPath: job.artifactPath, }; } @@ -43,12 +40,13 @@ export function transformManagedJob(job: Ios.ManagedJob): IosManagedJobInput { } function transformDistributionType(distributionType: Ios.DistributionType): DistributionType { - if (distributionType === 'store') { - return DistributionType.Store; - } else if (distributionType === 'internal') { - return DistributionType.Internal; - } else { - return DistributionType.Simulator; + switch (distributionType) { + case 'store': + return DistributionType.Store; + case 'internal': + return DistributionType.Internal; + default: + return DistributionType.Simulator; } } @@ -74,20 +72,10 @@ function transformIosSecrets(secrets: { }; } -function transformSchemeBuildConfiguration( - schemeBuildConfiguration: Ios.SchemeBuildConfiguration -): IosSchemeBuildConfiguration { - if (schemeBuildConfiguration === Ios.SchemeBuildConfiguration.DEBUG) { - return IosSchemeBuildConfiguration.Debug; - } else { - return IosSchemeBuildConfiguration.Release; - } -} - function transformBuildType(buildType: Ios.ManagedBuildType): IosManagedBuildType { if (buildType === Ios.ManagedBuildType.DEVELOPMENT_CLIENT) { return IosManagedBuildType.DevelopmentClient; - } else { - return IosManagedBuildType.Release; } + + return IosManagedBuildType.Release; } diff --git a/packages/eas-cli/src/build/ios/prepareJob.ts b/packages/eas-cli/src/build/ios/prepareJob.ts index 961840b97f..0e0f691a0b 100644 --- a/packages/eas-cli/src/build/ios/prepareJob.ts +++ b/packages/eas-cli/src/build/ios/prepareJob.ts @@ -127,10 +127,7 @@ async function prepareGenericJobAsync( })), type: Workflow.GENERIC, scheme: jobData.projectConfiguration.iosBuildScheme, - schemeBuildConfiguration: - buildProfile.schemeBuildConfiguration === 'Auto' - ? undefined - : buildProfile.schemeBuildConfiguration, + buildConfiguration: buildProfile.buildConfiguration, artifactPath: buildProfile.artifactPath, releaseChannel: buildProfile.releaseChannel, projectRootDirectory, diff --git a/packages/eas-cli/src/graphql/generated.ts b/packages/eas-cli/src/graphql/generated.ts index b4779cbbf5..9ee79745e5 100644 --- a/packages/eas-cli/src/graphql/generated.ts +++ b/packages/eas-cli/src/graphql/generated.ts @@ -152,6 +152,7 @@ export type Update = ActivityTimelineProjectActivity & { createdAt: Scalars['DateTime']; message?: Maybe; branch: UpdateBranch; + manifestPermalink: Scalars['String']; }; export type ActivityTimelineProjectActivity = { @@ -666,6 +667,7 @@ export type User = Actor & { /** Get all certified second factor authentication methods */ secondFactorDevices: Array; /** Associated accounts */ + primaryAccount: Account; accounts: Array; /** Access Tokens belonging to this actor */ accessTokens: Array; @@ -900,12 +902,47 @@ export type Submission = ActivityTimelineProjectActivity & { initiatingActor?: Maybe; platform: AppPlatform; status: SubmissionStatus; + androidConfig?: Maybe; + iosConfig?: Maybe; logsUrl?: Maybe; error?: Maybe; createdAt: Scalars['DateTime']; updatedAt: Scalars['DateTime']; }; +export type AndroidSubmissionConfig = { + __typename?: 'AndroidSubmissionConfig'; + applicationIdentifier: Scalars['String']; + archiveType: SubmissionAndroidArchiveType; + track: SubmissionAndroidTrack; + releaseStatus?: Maybe; +}; + +export enum SubmissionAndroidArchiveType { + Apk = 'APK', + Aab = 'AAB' +} + +export enum SubmissionAndroidTrack { + Production = 'PRODUCTION', + Internal = 'INTERNAL', + Alpha = 'ALPHA', + Beta = 'BETA' +} + +export enum SubmissionAndroidReleaseStatus { + Draft = 'DRAFT', + InProgress = 'IN_PROGRESS', + Halted = 'HALTED', + Completed = 'COMPLETED' +} + +export type IosSubmissionConfig = { + __typename?: 'IosSubmissionConfig'; + ascAppIdentifier: Scalars['String']; + appleIdUsername: Scalars['String']; +}; + export type SubmissionError = { __typename?: 'SubmissionError'; errorCode?: Maybe; @@ -1169,6 +1206,12 @@ export type UpdateBranch = { export type UpdateBranchUpdatesArgs = { offset: Scalars['Int']; limit: Scalars['Int']; + filter?: Maybe; +}; + +export type UpdatesFilter = { + platform?: Maybe; + runtimeVersions?: Maybe>; }; export type EnvironmentSecret = { @@ -2435,6 +2478,7 @@ export type IosGenericJobInput = { cache?: Maybe; scheme: Scalars['String']; schemeBuildConfiguration?: Maybe; + buildConfiguration?: Maybe; artifactPath?: Maybe; }; diff --git a/packages/eas-json/package.json b/packages/eas-json/package.json index 18a3808e0f..82c9aa2380 100644 --- a/packages/eas-json/package.json +++ b/packages/eas-json/package.json @@ -5,7 +5,7 @@ "author": "Expo ", "bugs": "https://github.com/expo/eas-cli/issues", "dependencies": { - "@expo/eas-build-job": "0.2.28", + "@expo/eas-build-job": "0.2.31", "@hapi/joi": "^17.1.1", "fs-extra": "^9.0.1", "tslib": "^1" @@ -40,4 +40,4 @@ "publishConfig": { "access": "public" } -} +} \ No newline at end of file diff --git a/packages/eas-json/src/Config.types.ts b/packages/eas-json/src/Config.types.ts index 4bad764a90..1f8bfa9913 100644 --- a/packages/eas-json/src/Config.types.ts +++ b/packages/eas-json/src/Config.types.ts @@ -48,7 +48,7 @@ export interface IosGenericBuildProfile extends Ios.BuilderEnvironment { workflow: Workflow.GENERIC; credentialsSource: CredentialsSource; scheme?: string; - schemeBuildConfiguration?: Ios.SchemeBuildConfiguration | 'Auto'; + buildConfiguration?: string; releaseChannel?: string; artifactPath?: string; distribution?: IosDistributionType; diff --git a/packages/eas-json/src/EasJsonSchema.ts b/packages/eas-json/src/EasJsonSchema.ts index a31db2ff78..c9f5877c3c 100644 --- a/packages/eas-json/src/EasJsonSchema.ts +++ b/packages/eas-json/src/EasJsonSchema.ts @@ -70,7 +70,7 @@ const IosGenericSchema = Joi.object({ workflow: Joi.string().valid('generic').required(), credentialsSource: Joi.string().valid('local', 'remote').default('remote'), scheme: Joi.string(), - schemeBuildConfiguration: Joi.string().valid('Debug', 'Release', 'Auto').default('Release'), + buildConfiguration: Joi.string(), releaseChannel: Joi.string(), artifactPath: Joi.string(), distribution: Joi.string().valid('store', 'internal', 'simulator').default('store'), diff --git a/packages/eas-json/src/__tests__/EasJsonReader-test.ts b/packages/eas-json/src/__tests__/EasJsonReader-test.ts index e624e22f62..ac6c8e7492 100644 --- a/packages/eas-json/src/__tests__/EasJsonReader-test.ts +++ b/packages/eas-json/src/__tests__/EasJsonReader-test.ts @@ -57,7 +57,7 @@ test('minimal valid ios eas.json', async () => { env: {}, cache: { disabled: false, cacheDefaultPaths: true, customPaths: [] }, image: 'default', - schemeBuildConfiguration: 'Release', + buildConfiguration: 'Release', }, }, }).toEqual(easJson); @@ -96,7 +96,7 @@ test('minimal valid eas.json for both platforms', async () => { env: {}, cache: { disabled: false, cacheDefaultPaths: true, customPaths: [] }, image: 'default', - schemeBuildConfiguration: 'Release', + buildConfiguration: 'Release', }, }, }).toEqual(easJson); diff --git a/yarn.lock b/yarn.lock index 3b5a035547..4851bf9578 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1183,10 +1183,10 @@ xcode "^3.0.0" xml-js "^1.6.11" -"@expo/eas-build-job@0.2.28": - version "0.2.28" - resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-0.2.28.tgz#5ec6fb82be38525e183f23891b947fb0cf243999" - integrity sha512-SqJvtTBiO9YgIo33oOudVkVhCYHBMmKrkIc1mZor6KuqVqNGz8kju25Qz3ldbw94OoS/7RPETn5TMM30c+NtCQ== +"@expo/eas-build-job@0.2.31": + version "0.2.31" + resolved "https://registry.yarnpkg.com/@expo/eas-build-job/-/eas-build-job-0.2.31.tgz#151a68d6262a9b62cd0f1cab903c1583e389445e" + integrity sha512-JJRC+c5PGmBuB9Q/r6dEDa64xWdsI43v+dmhDuSlRbH2ItwaWfh+oKwedw9SeekTvveDwY9diNIGdjoba8dbfA== dependencies: "@hapi/joi" "^17.1.1"