@expo/eas-build-job 0.2.96 → 0.2.98
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/android.d.ts +2 -8
- package/dist/android.js +2 -2
- package/dist/android.js.map +1 -1
- package/dist/common.d.ts +6 -0
- package/dist/common.js.map +1 -1
- package/dist/ios.d.ts +3 -3
- package/dist/ios.js +22 -6
- package/dist/ios.js.map +1 -1
- package/dist/job.d.ts +9 -2
- package/dist/job.js +42 -26
- package/dist/job.js.map +1 -1
- package/package.json +1 -1
package/dist/android.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import { ArchiveSource, Env, Platform, Workflow, Cache, EnvironmentSecret } from './common';
|
|
2
|
+
import { ArchiveSource, Env, Platform, Workflow, Cache, EnvironmentSecret, ImageMatchRule } from './common';
|
|
3
3
|
export interface Keystore {
|
|
4
4
|
dataBase64: string;
|
|
5
5
|
keystorePassword: string;
|
|
@@ -11,12 +11,7 @@ export declare enum BuildType {
|
|
|
11
11
|
APP_BUNDLE = "app-bundle"
|
|
12
12
|
}
|
|
13
13
|
export declare const builderBaseImages: readonly ["default", "latest", "stable", "ubuntu-18.04-android-30-ndk-r19c", "ubuntu-20.04-android-30-ndk-r21e", "ubuntu-18.04-jdk-8-ndk-r19c", "ubuntu-18.04-jdk-11-ndk-r19c", "ubuntu-20.04-jdk-8-ndk-r21e", "ubuntu-20.04-jdk-11-ndk-r21e", "ubuntu-22.04-jdk-8-ndk-r21e", "ubuntu-22.04-jdk-11-ndk-r21e"];
|
|
14
|
-
|
|
15
|
-
image: typeof builderBaseImages[number];
|
|
16
|
-
reactNativeSemverRange: string;
|
|
17
|
-
sdkSemverRange: string;
|
|
18
|
-
}
|
|
19
|
-
export declare const reactNativeImageMatchRules: ImageMatchRule[];
|
|
14
|
+
export declare const imageMatchRules: ImageMatchRule<typeof builderBaseImages[number]>[];
|
|
20
15
|
export interface BuilderEnvironment {
|
|
21
16
|
image?: typeof builderBaseImages[number];
|
|
22
17
|
node?: string;
|
|
@@ -64,4 +59,3 @@ export interface Job {
|
|
|
64
59
|
};
|
|
65
60
|
}
|
|
66
61
|
export declare const JobSchema: Joi.ObjectSchema<any>;
|
|
67
|
-
export {};
|
package/dist/android.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.JobSchema = exports.
|
|
6
|
+
exports.JobSchema = exports.imageMatchRules = exports.builderBaseImages = exports.BuildType = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
8
|
const common_1 = require("./common");
|
|
9
9
|
const KeystoreSchema = joi_1.default.object({
|
|
@@ -30,7 +30,7 @@ exports.builderBaseImages = [
|
|
|
30
30
|
'ubuntu-22.04-jdk-8-ndk-r21e',
|
|
31
31
|
'ubuntu-22.04-jdk-11-ndk-r21e',
|
|
32
32
|
];
|
|
33
|
-
exports.
|
|
33
|
+
exports.imageMatchRules = [
|
|
34
34
|
{
|
|
35
35
|
image: 'ubuntu-18.04-jdk-11-ndk-r19c',
|
|
36
36
|
reactNativeSemverRange: '>=0.68.0',
|
package/dist/android.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"android.js","sourceRoot":"","sources":["../src/android.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAEtB,
|
|
1
|
+
{"version":3,"file":"android.js","sourceRoot":"","sources":["../src/android.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAEtB,qCAYkB;AASlB,MAAM,cAAc,GAAG,aAAG,CAAC,MAAM,CAAC;IAChC,UAAU,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACnC,gBAAgB,EAAE,aAAG,CAAC,MAAM,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M,EAAE,CAAC,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IAC1D,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE;IAEtB,YAAY,EAAE,aAAG,CAAC,MAAM,CAAC;QACvB,eAAe,EAAE,aAAG,CAAC,MAAM,EAAE;KAC9B,CAAC;CACH,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import Joi from 'joi';\n\nimport {\n ArchiveSource,\n ArchiveSourceSchema,\n Env,\n EnvSchema,\n Platform,\n Workflow,\n Cache,\n CacheSchema,\n EnvironmentSecretsSchema,\n EnvironmentSecret,\n ImageMatchRule,\n} from './common';\n\nexport interface Keystore {\n dataBase64: string;\n keystorePassword: string;\n keyAlias: string;\n keyPassword?: string;\n}\n\nconst KeystoreSchema = Joi.object({\n dataBase64: Joi.string().required(),\n keystorePassword: Joi.string().allow('').required(),\n keyAlias: Joi.string().required(),\n keyPassword: Joi.string().allow(''),\n});\n\nexport enum BuildType {\n APK = 'apk',\n APP_BUNDLE = 'app-bundle',\n}\n\nexport const builderBaseImages = [\n 'default',\n 'latest',\n 'stable',\n 'ubuntu-18.04-android-30-ndk-r19c', // legacy naming (image with java 8)\n 'ubuntu-20.04-android-30-ndk-r21e', // legacy naming (image with java 8)\n 'ubuntu-18.04-jdk-8-ndk-r19c',\n 'ubuntu-18.04-jdk-11-ndk-r19c',\n 'ubuntu-20.04-jdk-8-ndk-r21e',\n 'ubuntu-20.04-jdk-11-ndk-r21e',\n 'ubuntu-22.04-jdk-8-ndk-r21e',\n 'ubuntu-22.04-jdk-11-ndk-r21e',\n] as const;\n\nexport const imageMatchRules: ImageMatchRule<typeof builderBaseImages[number]>[] = [\n {\n image: 'ubuntu-18.04-jdk-11-ndk-r19c',\n reactNativeSemverRange: '>=0.68.0',\n sdkSemverRange: '<46',\n },\n {\n image: 'ubuntu-18.04-jdk-8-ndk-r19c',\n reactNativeSemverRange: '<0.68.0',\n sdkSemverRange: '<46',\n },\n {\n image: 'ubuntu-20.04-jdk-11-ndk-r21e',\n reactNativeSemverRange: '>=0.68.0',\n sdkSemverRange: '>=46',\n },\n {\n image: 'ubuntu-20.04-jdk-8-ndk-r21e',\n reactNativeSemverRange: '<0.68.0',\n sdkSemverRange: '>=46',\n },\n];\n\nexport interface BuilderEnvironment {\n image?: typeof builderBaseImages[number];\n node?: string;\n yarn?: string;\n expoCli?: string;\n ndk?: string;\n env?: Env;\n}\n\nconst BuilderEnvironmentSchema = Joi.object({\n image: Joi.string().valid(...builderBaseImages),\n node: Joi.string(),\n yarn: Joi.string(),\n expoCli: Joi.string(),\n ndk: Joi.string(),\n env: EnvSchema,\n});\n\nexport interface Job {\n type: Workflow;\n projectArchive: ArchiveSource;\n platform: Platform.ANDROID;\n projectRootDirectory: string;\n releaseChannel?: string;\n updates?: {\n channel?: string;\n };\n secrets: {\n buildCredentials?: {\n keystore: Keystore;\n };\n environmentSecrets?: EnvironmentSecret[];\n };\n builderEnvironment?: BuilderEnvironment;\n cache: Cache;\n developmentClient?: boolean;\n version?: {\n versionCode?: string;\n /**\n * support for this field is implemented, but specifying it is disabled on schema level\n */\n versionName?: string;\n /**\n * support for this field is implemented, but specifying it is disabled on schema level\n */\n runtimeVersion?: string;\n };\n buildArtifactPaths?: string[];\n\n gradleCommand?: string;\n applicationArchivePath?: string;\n\n buildType?: BuildType;\n username?: string;\n\n experimental?: {\n prebuildCommand?: string;\n };\n}\n\nexport const JobSchema = Joi.object({\n type: Joi.string()\n .valid(...Object.values(Workflow))\n .required(),\n projectArchive: ArchiveSourceSchema.required(),\n platform: Joi.string().valid(Platform.ANDROID).required(),\n projectRootDirectory: Joi.string().required(),\n releaseChannel: Joi.string(),\n updates: Joi.object({\n channel: Joi.string(),\n }),\n secrets: Joi.object({\n buildCredentials: Joi.object({ keystore: KeystoreSchema.required() }),\n environmentSecrets: EnvironmentSecretsSchema,\n }).required(),\n builderEnvironment: BuilderEnvironmentSchema,\n cache: CacheSchema.default(),\n developmentClient: Joi.boolean(),\n version: Joi.object({\n versionCode: Joi.string().regex(/^\\d+$/),\n }),\n buildArtifactPaths: Joi.array().items(Joi.string()),\n\n gradleCommand: Joi.string(),\n applicationArchivePath: Joi.string(),\n\n buildType: Joi.string().valid(...Object.values(BuildType)),\n username: Joi.string(),\n\n experimental: Joi.object({\n prebuildCommand: Joi.string(),\n }),\n}).oxor('releaseChannel', 'updates.channel');\n"]}
|
package/dist/common.d.ts
CHANGED
|
@@ -53,3 +53,9 @@ export interface BuildPhaseStats {
|
|
|
53
53
|
result: BuildPhaseResult;
|
|
54
54
|
durationMs: number;
|
|
55
55
|
}
|
|
56
|
+
export interface ImageMatchRule<Image extends string> {
|
|
57
|
+
image: Image;
|
|
58
|
+
reactNativeSemverRange?: string;
|
|
59
|
+
sdkSemverRange?: string;
|
|
60
|
+
workflows?: Workflow[];
|
|
61
|
+
}
|
package/dist/common.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAItB,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;AACrB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,uBAAW,CAAA;AACb,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,gCAAW,CAAA;AACb,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AAQY,QAAA,mBAAmB,GAAG,aAAG,CAAC,MAAM,CAAgB;IAC3D,IAAI,EAAE,aAAG,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GAAG,CAAC;IACpC,iBAAiB,EAAE,aAAG,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAC9C,WAAW,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD,CAAC,CAAC","sourcesContent":["import Joi from 'joi';\n\nimport { BuildPhase, BuildPhaseResult } from './logs';\n\nexport enum Workflow {\n GENERIC = 'generic',\n MANAGED = 'managed',\n}\n\nexport enum Platform {\n ANDROID = 'android',\n IOS = 'ios',\n}\n\nexport enum ArchiveSourceType {\n S3 = 'S3',\n URL = 'URL',\n PATH = 'PATH',\n GCS = 'GCS',\n}\n\nexport type ArchiveSource =\n | { type: ArchiveSourceType.S3; bucketKey: string }\n | { type: ArchiveSourceType.GCS; bucketKey: string }\n | { type: ArchiveSourceType.URL; url: string }\n | { type: ArchiveSourceType.PATH; path: string };\n\nexport const ArchiveSourceSchema = Joi.object<ArchiveSource>({\n type: Joi.string()\n .valid(...Object.values(ArchiveSourceType))\n .required(),\n})\n .when(Joi.object({ type: ArchiveSourceType.GCS }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.GCS).required(),\n bucketKey: Joi.string().required(),\n }),\n })\n .when(Joi.object({ type: ArchiveSourceType.S3 }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.S3).required(),\n bucketKey: Joi.string().required(),\n }),\n })\n .when(Joi.object({ type: ArchiveSourceType.URL }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.URL).required(),\n url: Joi.string().uri().required(),\n }),\n })\n .when(Joi.object({ type: ArchiveSourceType.PATH }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.PATH).required(),\n path: Joi.string().required(),\n }),\n });\n\nexport type Env = Record<string, string>;\nexport const EnvSchema = Joi.object().pattern(Joi.string(), Joi.string());\n\nexport type EnvironmentSecret = {\n name: string;\n type: EnvironmentSecretType;\n value: string;\n};\nexport enum EnvironmentSecretType {\n STRING = 'string',\n FILE = 'file',\n}\nexport const EnvironmentSecretsSchema = Joi.array().items(\n Joi.object({\n name: Joi.string().required(),\n value: Joi.string().required(),\n type: Joi.string()\n .valid(...Object.values(EnvironmentSecretType))\n .required(),\n })\n);\n\nexport interface Cache {\n disabled: boolean;\n clear: boolean;\n key?: string;\n cacheDefaultPaths: boolean;\n customPaths: string[];\n}\n\nexport const CacheSchema = Joi.object({\n disabled: Joi.boolean().default(false),\n clear: Joi.boolean().default(false),\n key: Joi.string().allow('').max(128),\n cacheDefaultPaths: Joi.boolean().default(true),\n customPaths: Joi.array().items(Joi.string()).default([]),\n});\n\nexport interface BuildPhaseStats {\n buildPhase: BuildPhase;\n result: BuildPhaseResult;\n durationMs: number;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAItB,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,+BAAmB,CAAA;AACrB,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,uBAAW,CAAA;AACb,CAAC,EAHW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAGnB;AAED,IAAY,iBAKX;AALD,WAAY,iBAAiB;IAC3B,8BAAS,CAAA;IACT,gCAAW,CAAA;IACX,kCAAa,CAAA;IACb,gCAAW,CAAA;AACb,CAAC,EALW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAK5B;AAQY,QAAA,mBAAmB,GAAG,aAAG,CAAC,MAAM,CAAgB;IAC3D,IAAI,EAAE,aAAG,CAAC,MAAM,EAAE;SACf,KAAK,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,CA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AAC;IAC9C,WAAW,EAAE,aAAG,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,aAAG,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD,CAAC,CAAC","sourcesContent":["import Joi from 'joi';\n\nimport { BuildPhase, BuildPhaseResult } from './logs';\n\nexport enum Workflow {\n GENERIC = 'generic',\n MANAGED = 'managed',\n}\n\nexport enum Platform {\n ANDROID = 'android',\n IOS = 'ios',\n}\n\nexport enum ArchiveSourceType {\n S3 = 'S3',\n URL = 'URL',\n PATH = 'PATH',\n GCS = 'GCS',\n}\n\nexport type ArchiveSource =\n | { type: ArchiveSourceType.S3; bucketKey: string }\n | { type: ArchiveSourceType.GCS; bucketKey: string }\n | { type: ArchiveSourceType.URL; url: string }\n | { type: ArchiveSourceType.PATH; path: string };\n\nexport const ArchiveSourceSchema = Joi.object<ArchiveSource>({\n type: Joi.string()\n .valid(...Object.values(ArchiveSourceType))\n .required(),\n})\n .when(Joi.object({ type: ArchiveSourceType.GCS }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.GCS).required(),\n bucketKey: Joi.string().required(),\n }),\n })\n .when(Joi.object({ type: ArchiveSourceType.S3 }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.S3).required(),\n bucketKey: Joi.string().required(),\n }),\n })\n .when(Joi.object({ type: ArchiveSourceType.URL }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.URL).required(),\n url: Joi.string().uri().required(),\n }),\n })\n .when(Joi.object({ type: ArchiveSourceType.PATH }).unknown(), {\n then: Joi.object({\n type: Joi.string().valid(ArchiveSourceType.PATH).required(),\n path: Joi.string().required(),\n }),\n });\n\nexport type Env = Record<string, string>;\nexport const EnvSchema = Joi.object().pattern(Joi.string(), Joi.string());\n\nexport type EnvironmentSecret = {\n name: string;\n type: EnvironmentSecretType;\n value: string;\n};\nexport enum EnvironmentSecretType {\n STRING = 'string',\n FILE = 'file',\n}\nexport const EnvironmentSecretsSchema = Joi.array().items(\n Joi.object({\n name: Joi.string().required(),\n value: Joi.string().required(),\n type: Joi.string()\n .valid(...Object.values(EnvironmentSecretType))\n .required(),\n })\n);\n\nexport interface Cache {\n disabled: boolean;\n clear: boolean;\n key?: string;\n cacheDefaultPaths: boolean;\n customPaths: string[];\n}\n\nexport const CacheSchema = Joi.object({\n disabled: Joi.boolean().default(false),\n clear: Joi.boolean().default(false),\n key: Joi.string().allow('').max(128),\n cacheDefaultPaths: Joi.boolean().default(true),\n customPaths: Joi.array().items(Joi.string()).default([]),\n});\n\nexport interface BuildPhaseStats {\n buildPhase: BuildPhase;\n result: BuildPhaseResult;\n durationMs: number;\n}\n\nexport interface ImageMatchRule<Image extends string> {\n image: Image;\n reactNativeSemverRange?: string;\n sdkSemverRange?: string;\n workflows?: Workflow[];\n}\n"]}
|
package/dist/ios.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
-
import { ArchiveSource, Env, Platform, Workflow, Cache, EnvironmentSecret } from './common';
|
|
2
|
+
import { ArchiveSource, Env, Platform, Workflow, Cache, EnvironmentSecret, ImageMatchRule } from './common';
|
|
3
3
|
export declare type DistributionType = 'store' | 'internal' | 'simulator';
|
|
4
4
|
export interface TargetCredentials {
|
|
5
5
|
provisioningProfileBase64: string;
|
|
@@ -11,8 +11,8 @@ export interface DistributionCertificate {
|
|
|
11
11
|
dataBase64: string;
|
|
12
12
|
password: string;
|
|
13
13
|
}
|
|
14
|
-
export declare const builderBaseImages: readonly ["default", "latest", "stable", "macos-big-sur-11.4-xcode-12.5", "macos-big-sur-11.4-xcode-13.0", "macos-monterey-12.1-xcode-13.2", "macos-monterey-12.3-xcode-13.3", "macos-monterey-12.4-xcode-13.4", "macos-monterey-12.6-xcode-14.0"];
|
|
15
|
-
export declare const
|
|
14
|
+
export declare const builderBaseImages: readonly ["default", "latest", "stable", "macos-big-sur-11.4-xcode-12.5", "macos-big-sur-11.4-xcode-13.0", "macos-monterey-12.1-xcode-13.2", "macos-monterey-12.3-xcode-13.3", "macos-monterey-12.4-xcode-13.4", "macos-monterey-12.6-xcode-14.0", "macos-monterey-12.6-xcode-14.1"];
|
|
15
|
+
export declare const imageMatchRules: ImageMatchRule<typeof builderBaseImages[number]>[];
|
|
16
16
|
export interface BuilderEnvironment {
|
|
17
17
|
image?: typeof builderBaseImages[number];
|
|
18
18
|
node?: string;
|
package/dist/ios.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.JobSchema = exports.
|
|
6
|
+
exports.JobSchema = exports.imageMatchRules = exports.builderBaseImages = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
8
|
const common_1 = require("./common");
|
|
9
9
|
const TargetCredentialsSchema = joi_1.default.object().keys({
|
|
@@ -24,12 +24,28 @@ exports.builderBaseImages = [
|
|
|
24
24
|
'macos-monterey-12.3-xcode-13.3',
|
|
25
25
|
'macos-monterey-12.4-xcode-13.4',
|
|
26
26
|
'macos-monterey-12.6-xcode-14.0',
|
|
27
|
+
'macos-monterey-12.6-xcode-14.1',
|
|
28
|
+
];
|
|
29
|
+
exports.imageMatchRules = [
|
|
30
|
+
{
|
|
31
|
+
image: 'macos-big-sur-11.4-xcode-13.0',
|
|
32
|
+
sdkSemverRange: '<=44',
|
|
33
|
+
workflows: [common_1.Workflow.MANAGED],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
image: 'macos-monterey-12.4-xcode-13.4',
|
|
37
|
+
sdkSemverRange: '>=45 <47',
|
|
38
|
+
workflows: [common_1.Workflow.MANAGED],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
image: 'macos-monterey-12.6-xcode-14.0',
|
|
42
|
+
sdkSemverRange: '>=47',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
image: 'macos-monterey-12.6-xcode-14.0',
|
|
46
|
+
reactNativeSemverRange: '>=0.70.0',
|
|
47
|
+
},
|
|
27
48
|
];
|
|
28
|
-
exports.sdkVersionToDefaultBuilderImage = {
|
|
29
|
-
'<=44': 'macos-big-sur-11.4-xcode-13.0',
|
|
30
|
-
'>=45 <47': 'macos-monterey-12.4-xcode-13.4',
|
|
31
|
-
'>=47': 'macos-monterey-12.6-xcode-14.0',
|
|
32
|
-
};
|
|
33
49
|
const BuilderEnvironmentSchema = joi_1.default.object({
|
|
34
50
|
image: joi_1.default.string().valid(...exports.builderBaseImages),
|
|
35
51
|
node: joi_1.default.string(),
|
package/dist/ios.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../src/ios.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAEtB,
|
|
1
|
+
{"version":3,"file":"ios.js","sourceRoot":"","sources":["../src/ios.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAEtB,qCAYkB;AAIlB,MAAM,uBAAuB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC;IAChD,yBAAyB,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClD,uBAAuB,EAAE,aAAG,CAAC,MAAM,CAAC;QAClC,UAAU,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QACnC,QAAQ,EAAE,aAAG,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC5C,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC;AAOH,MAAM,sBAAsB,GAAG,aAAG,CAAC,MAAM,EAAE,CAAC,OAAO,CACjD,aAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EACvB,uBAAuB,CACxB,CAAC;A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entSecretsSchema,\n EnvironmentSecret,\n ImageMatchRule,\n} from './common';\n\nexport type DistributionType = 'store' | 'internal' | 'simulator';\n\nconst TargetCredentialsSchema = Joi.object().keys({\n provisioningProfileBase64: Joi.string().required(),\n distributionCertificate: Joi.object({\n dataBase64: Joi.string().required(),\n password: Joi.string().allow('').required(),\n }).required(),\n});\n\nexport interface TargetCredentials {\n provisioningProfileBase64: string;\n distributionCertificate: DistributionCertificate;\n}\n\nconst BuildCredentialsSchema = Joi.object().pattern(\n Joi.string().required(),\n TargetCredentialsSchema\n);\n\ntype Target = string;\nexport type BuildCredentials = Record<Target, TargetCredentials>;\n\nexport interface DistributionCertificate {\n dataBase64: string;\n password: string;\n}\n\nexport const builderBaseImages = [\n 'default',\n 'latest',\n 'stable',\n 'macos-big-sur-11.4-xcode-12.5',\n 'macos-big-sur-11.4-xcode-13.0',\n 'macos-monterey-12.1-xcode-13.2',\n 'macos-monterey-12.3-xcode-13.3',\n 'macos-monterey-12.4-xcode-13.4',\n 'macos-monterey-12.6-xcode-14.0',\n 'macos-monterey-12.6-xcode-14.1',\n] as const;\n\nexport const imageMatchRules: ImageMatchRule<typeof builderBaseImages[number]>[] = [\n {\n image: 'macos-big-sur-11.4-xcode-13.0',\n sdkSemverRange: '<=44',\n workflows: [Workflow.MANAGED],\n },\n {\n image: 'macos-monterey-12.4-xcode-13.4',\n sdkSemverRange: '>=45 <47',\n workflows: [Workflow.MANAGED],\n },\n {\n image: 'macos-monterey-12.6-xcode-14.0',\n sdkSemverRange: '>=47',\n },\n {\n image: 'macos-monterey-12.6-xcode-14.0',\n reactNativeSemverRange: '>=0.70.0',\n },\n];\n\nexport interface BuilderEnvironment {\n image?: typeof builderBaseImages[number];\n node?: string;\n yarn?: string;\n expoCli?: string;\n bundler?: string;\n fastlane?: string;\n cocoapods?: string;\n env?: Env;\n}\n\nconst BuilderEnvironmentSchema = Joi.object({\n image: Joi.string().valid(...builderBaseImages),\n node: Joi.string(),\n yarn: Joi.string(),\n expoCli: Joi.string(),\n bundler: Joi.string(),\n fastlane: Joi.string(),\n cocoapods: Joi.string(),\n env: EnvSchema,\n});\n\nexport interface Job {\n type: Workflow;\n projectArchive: ArchiveSource;\n platform: Platform.IOS;\n projectRootDirectory: string;\n releaseChannel?: string;\n updates?: {\n channel?: string;\n };\n secrets: {\n buildCredentials?: BuildCredentials;\n environmentSecrets?: EnvironmentSecret[];\n };\n builderEnvironment?: BuilderEnvironment;\n cache: Cache;\n developmentClient?: boolean;\n simulator?: boolean;\n version?: {\n buildNumber?: string;\n /**\n * support for this field is implemented, but specifying it is disabled on schema level\n */\n appVersion?: string;\n /**\n * support for this field is implemented, but specifying it is disabled on schema level\n */\n runtimeVersion?: string;\n };\n buildArtifactPaths?: string[];\n\n scheme?: string;\n buildConfiguration?: string;\n applicationArchivePath?: string;\n\n username?: string;\n\n experimental?: {\n prebuildCommand?: string;\n };\n}\n\nexport const JobSchema = Joi.object({\n type: Joi.string()\n .valid(...Object.values(Workflow))\n .required(),\n projectArchive: ArchiveSourceSchema.required(),\n platform: Joi.string().valid(Platform.IOS).required(),\n projectRootDirectory: Joi.string().required(),\n releaseChannel: Joi.string(),\n updates: Joi.object({\n channel: Joi.string(),\n }),\n secrets: Joi.object({\n buildCredentials: BuildCredentialsSchema,\n environmentSecrets: EnvironmentSecretsSchema,\n }).required(),\n builderEnvironment: BuilderEnvironmentSchema,\n cache: CacheSchema.default(),\n developmentClient: Joi.boolean(),\n simulator: Joi.boolean(),\n version: Joi.object({\n buildNumber: Joi.string(),\n }),\n buildArtifactPaths: Joi.array().items(Joi.string()),\n\n scheme: Joi.string(),\n buildConfiguration: Joi.string(),\n applicationArchivePath: Joi.string(),\n\n username: Joi.string(),\n\n experimental: Joi.object({\n prebuildCommand: Joi.string(),\n }),\n}).oxor('releaseChannel', 'updates.channel');\n"]}
|
package/dist/job.d.ts
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import Joi from 'joi';
|
|
2
|
+
import { Workflow } from './common';
|
|
2
3
|
import * as Android from './android';
|
|
3
4
|
import * as Ios from './ios';
|
|
4
5
|
export declare type Job = Android.Job | Ios.Job;
|
|
6
|
+
interface ImageMatchArgs {
|
|
7
|
+
sdkVersion?: string;
|
|
8
|
+
reactNativeVersion?: string;
|
|
9
|
+
workflow: Workflow;
|
|
10
|
+
}
|
|
5
11
|
export declare const JobSchema: Joi.ObjectSchema<Job>;
|
|
6
12
|
export declare function sanitizeJob(rawJob: object, { sdkVersion, reactNativeVersion }?: {
|
|
7
13
|
reactNativeVersion?: string;
|
|
8
14
|
sdkVersion?: string;
|
|
9
15
|
}): Job;
|
|
10
|
-
export declare function setAndroidBuilderImage(job: Job,
|
|
11
|
-
export declare function
|
|
16
|
+
export declare function setAndroidBuilderImage(job: Job, args: ImageMatchArgs): void;
|
|
17
|
+
export declare function setIosBuilderImage(job: Job, args: ImageMatchArgs): void;
|
|
18
|
+
export {};
|
package/dist/job.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.setIosBuilderImage = exports.setAndroidBuilderImage = exports.sanitizeJob = exports.JobSchema = void 0;
|
|
30
30
|
const joi_1 = __importDefault(require("joi"));
|
|
31
31
|
const semver_1 = __importDefault(require("semver"));
|
|
32
32
|
const common_1 = require("./common");
|
|
@@ -40,17 +40,25 @@ exports.JobSchema = joi_1.default.object({
|
|
|
40
40
|
.when(joi_1.default.object({ platform: common_1.Platform.ANDROID }).unknown(), { then: Android.JobSchema })
|
|
41
41
|
.when(joi_1.default.object({ platform: common_1.Platform.IOS }).unknown(), { then: Ios.JobSchema });
|
|
42
42
|
function sanitizeJob(rawJob, { sdkVersion, reactNativeVersion } = {}) {
|
|
43
|
+
var _a;
|
|
43
44
|
const { value, error } = exports.JobSchema.validate(rawJob, {
|
|
44
45
|
stripUnknown: true,
|
|
45
46
|
convert: true,
|
|
46
47
|
abortEarly: false,
|
|
47
48
|
});
|
|
48
49
|
const job = value;
|
|
49
|
-
if (job.
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
if (!((_a = job === null || job === void 0 ? void 0 : job.builderEnvironment) === null || _a === void 0 ? void 0 : _a.image)) {
|
|
51
|
+
const resolveArgs = {
|
|
52
|
+
sdkVersion,
|
|
53
|
+
reactNativeVersion,
|
|
54
|
+
workflow: job.type,
|
|
55
|
+
};
|
|
56
|
+
if (job.platform === common_1.Platform.IOS) {
|
|
57
|
+
setIosBuilderImage(job, resolveArgs);
|
|
58
|
+
}
|
|
59
|
+
else if (job.platform === common_1.Platform.ANDROID) {
|
|
60
|
+
setAndroidBuilderImage(job, resolveArgs);
|
|
61
|
+
}
|
|
54
62
|
}
|
|
55
63
|
if (error) {
|
|
56
64
|
throw error;
|
|
@@ -60,32 +68,40 @@ function sanitizeJob(rawJob, { sdkVersion, reactNativeVersion } = {}) {
|
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
70
|
exports.sanitizeJob = sanitizeJob;
|
|
63
|
-
function
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
function doesImageRuleMatch(rule, { sdkVersion, reactNativeVersion, workflow }) {
|
|
72
|
+
if (rule.reactNativeSemverRange) {
|
|
73
|
+
if (!reactNativeVersion || !semver_1.default.satisfies(reactNativeVersion, rule.reactNativeSemverRange)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (rule.sdkSemverRange) {
|
|
78
|
+
if (!sdkVersion || !semver_1.default.satisfies(sdkVersion, rule.sdkSemverRange)) {
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
67
81
|
}
|
|
68
|
-
|
|
69
|
-
if (
|
|
70
|
-
|
|
71
|
-
|
|
82
|
+
if (rule.workflows) {
|
|
83
|
+
if (!workflow || !rule.workflows.includes(workflow)) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
function setAndroidBuilderImage(job, args) {
|
|
90
|
+
for (const rule of Android.imageMatchRules) {
|
|
91
|
+
if (doesImageRuleMatch(rule, args)) {
|
|
92
|
+
job.builderEnvironment = Object.assign(Object.assign({}, job.builderEnvironment), { image: rule.image });
|
|
72
93
|
return;
|
|
73
94
|
}
|
|
74
95
|
}
|
|
75
96
|
}
|
|
76
97
|
exports.setAndroidBuilderImage = setAndroidBuilderImage;
|
|
77
|
-
function
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const matchingRange = ranges.find((range) => semver_1.default.satisfies(sdkVersion, range));
|
|
84
|
-
if (!matchingRange) {
|
|
85
|
-
return;
|
|
98
|
+
function setIosBuilderImage(job, args) {
|
|
99
|
+
for (const rule of Ios.imageMatchRules) {
|
|
100
|
+
if (doesImageRuleMatch(rule, args)) {
|
|
101
|
+
job.builderEnvironment = Object.assign(Object.assign({}, job.builderEnvironment), { image: rule.image });
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
86
104
|
}
|
|
87
|
-
const image = Ios.sdkVersionToDefaultBuilderImage[matchingRange];
|
|
88
|
-
job.builderEnvironment = Object.assign({ image }, job.builderEnvironment);
|
|
89
105
|
}
|
|
90
|
-
exports.
|
|
106
|
+
exports.setIosBuilderImage = setIosBuilderImage;
|
|
91
107
|
//# sourceMappingURL=job.js.map
|
package/dist/job.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"job.js","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAsB;AACtB,oDAA4B;AAE5B,
|
|
1
|
+
{"version":3,"file":"job.js","sourceRoot":"","sources":["../src/job.ts"],"names":[],"mappings":";;;;;;;;;;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AAoB;IAC/D,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,eAAe,EAAE;QACtC,IAAI,kBAAkB,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE;YAClC,GAAG,CAAC,kBAAkB,mCACjB,GAAG,CAAC,kBAAkB,KACzB,KAAK,EAAE,IAAI,CAAC,KAAK,GAClB,CAAC;YACF,OAAO;SACR;KACF;AACH,CAAC;AAVD,gDAUC","sourcesContent":["import Joi from 'joi';\nimport semver from 'semver';\n\nimport { ImageMatchRule, Platform, Workflow } from './common';\nimport * as Android from './android';\nimport * as Ios from './ios';\n\nexport type Job = Android.Job | Ios.Job;\n\ninterface ImageMatchArgs {\n sdkVersion?: string;\n reactNativeVersion?: string;\n workflow: Workflow;\n}\n\nexport const JobSchema = Joi.object<Job>({\n platform: Joi.string()\n .valid(...Object.values(Platform))\n .required(),\n})\n .when(Joi.object({ platform: Platform.ANDROID }).unknown(), { then: Android.JobSchema })\n .when(Joi.object({ platform: Platform.IOS }).unknown(), { then: Ios.JobSchema });\n\nexport function sanitizeJob(\n rawJob: object,\n { sdkVersion, reactNativeVersion }: { reactNativeVersion?: string; sdkVersion?: string } = {}\n): Job {\n const { value, error } = JobSchema.validate(rawJob, {\n stripUnknown: true,\n convert: true,\n abortEarly: false,\n });\n\n const job: Job = value;\n if (!job?.builderEnvironment?.image) {\n const resolveArgs: ImageMatchArgs = {\n sdkVersion,\n reactNativeVersion,\n workflow: job.type,\n };\n if (job.platform === Platform.IOS) {\n setIosBuilderImage(job, resolveArgs);\n } else if (job.platform === Platform.ANDROID) {\n setAndroidBuilderImage(job, resolveArgs);\n }\n }\n\n if (error) {\n throw error;\n } else {\n return job;\n }\n}\n\nfunction doesImageRuleMatch<T extends string>(\n rule: ImageMatchRule<T>,\n { sdkVersion, reactNativeVersion, workflow }: ImageMatchArgs\n): boolean {\n if (rule.reactNativeSemverRange) {\n if (!reactNativeVersion || !semver.satisfies(reactNativeVersion, rule.reactNativeSemverRange)) {\n return false;\n }\n }\n if (rule.sdkSemverRange) {\n if (!sdkVersion || !semver.satisfies(sdkVersion, rule.sdkSemverRange)) {\n return false;\n }\n }\n if (rule.workflows) {\n if (!workflow || !rule.workflows.includes(workflow)) {\n return false;\n }\n }\n return true;\n}\n\nexport function setAndroidBuilderImage(job: Job, args: ImageMatchArgs): void {\n for (const rule of Android.imageMatchRules) {\n if (doesImageRuleMatch(rule, args)) {\n job.builderEnvironment = {\n ...job.builderEnvironment,\n image: rule.image,\n };\n return;\n }\n }\n}\n\nexport function setIosBuilderImage(job: Job, args: ImageMatchArgs): void {\n for (const rule of Ios.imageMatchRules) {\n if (doesImageRuleMatch(rule, args)) {\n job.builderEnvironment = {\n ...job.builderEnvironment,\n image: rule.image,\n };\n return;\n }\n }\n}\n"]}
|