Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"which": "^1.2.7",
"wordwrap": "1.0.0",
"xcode": "^3.0.1",
"xml2js": "^0.6.0",
"yargs": "^17.7.2",
"yazl": "^2.5.1"
},
Expand Down
307 changes: 168 additions & 139 deletions script/command-executor.ts

Large diffs are not rendered by default.

46 changes: 46 additions & 0 deletions script/command-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,14 @@ yargs
description: "Semver expression that specifies the binary app version(s) this release is targeting (e.g. 1.1.0, ~1.2.3).",
type: "string",
})
.option("buildNumber", {
alias: "bn",
default: undefined,
demand: false,
description:
'Retarget this release to a specific native build (e.g. "100"). Pass an empty string ("") to reset to wildcard (all builds).',
type: "string",
})
.check((argv: any, aliases: { [aliases: string]: string }): any => {
return isValidRollout(argv);
});
Expand Down Expand Up @@ -666,6 +674,14 @@ yargs
description: "Percentage of users this release should be available to",
type: "string",
})
.option("buildNumber", {
alias: "bn",
default: null,
demand: false,
description:
"Target clients on a specific native build (CFBundleVersion on iOS, versionCode on Android). Requires an exact appVersion (e.g. 1.2.3, not a range) and an existing native release with that build number. If omitted, targets all clients on the specified appVersion.",
type: "string",
})
.check((argv: any, aliases: { [aliases: string]: string }): any => {
return checkValidReleaseOptions(argv);
});
Expand Down Expand Up @@ -860,6 +876,14 @@ yargs
description: "Option that gets passed to react-native bundler. Can be specified multiple times.",
type: "array",
})
.option("buildNumber", {
alias: "bn",
default: null,
demand: false,
description:
"Target clients on a specific native build (CFBundleVersion on iOS, versionCode on Android). Requires an exact appVersion (e.g. 1.2.3, not a range) and an existing native release with that build number. If omitted, targets all clients on the specified appVersion.",
type: "string",
})
.check((argv: any, aliases: { [aliases: string]: string }): any => {
return checkValidReleaseOptions(argv);
});
Expand Down Expand Up @@ -1052,6 +1076,14 @@ yargs
description: "Option that gets passed to react-native bundler. Can be specified multiple times.",
type: "array",
})
.option("buildNumber", {
alias: "bn",
default: null,
demand: false,
description:
"Target clients on a specific native build (CFBundleVersion on iOS, versionCode on Android). Requires an exact appVersion (e.g. 1.2.3, not a range) and an existing native release with that build number. If omitted, targets all clients on the specified appVersion.",
type: "string",
})
.check((argv: any) => {
return checkValidReleaseOptions(argv);
});
Expand Down Expand Up @@ -1084,6 +1116,14 @@ yargs
description: "Semver expression that specifies the binary app version(s) this release is targeting (e.g. 1.1.0, ~1.2.3).",
type: "string",
})
.option("buildNumber", {
alias: "bn",
default: null,
demand: false,
description:
"Targets this release to clients running a specific native binary build — CFBundleVersion on iOS or versionCode on Android. If omitted, auto-detected from the target binary (IPA/APK/AAB). Override when the value is set dynamically (e.g. on CI).",
type: "string",
})
.check((argv: any, aliases: { [aliases: string]: string }): any => {
return checkValidReleaseOptions(argv);
});
Expand Down Expand Up @@ -1411,6 +1451,8 @@ export function createCommand(): cli.ICommand {
patchCommand.mandatory = argv["mandatory"] as any;
patchCommand.rollout = getRolloutValue(argv["rollout"] as any);
patchCommand.appStoreVersion = argv["targetBinaryVersion"] as any;
// undefined = not provided (skip); null = reset to wildcard (empty string ""); string = retarget to that build.
patchCommand.buildNumber = argv["buildNumber"] !== undefined ? (argv["buildNumber"] as string) || null : undefined;
}
break;

Expand Down Expand Up @@ -1450,6 +1492,7 @@ export function createCommand(): cli.ICommand {
releaseCommand.appName = arg1;
releaseCommand.package = arg2;
releaseCommand.appStoreVersion = arg3;
releaseCommand.buildNumber = argv["buildNumber"] as any;
releaseCommand.deploymentName = argv["deploymentName"] as any;
releaseCommand.description = argv["description"] ? backslash(argv["description"]) : "";
releaseCommand.disabled = argv["disabled"] as any;
Expand All @@ -1469,6 +1512,7 @@ export function createCommand(): cli.ICommand {
releaseReactCommand.platform = arg2;

releaseReactCommand.appStoreVersion = argv["targetBinaryVersion"] as any;
releaseReactCommand.buildNumber = argv["buildNumber"] as any;
releaseReactCommand.bundleName = argv["bundleName"] as any;
releaseReactCommand.deploymentName = argv["deploymentName"] as any;
releaseReactCommand.disabled = argv["disabled"] as any;
Expand Down Expand Up @@ -1505,6 +1549,7 @@ export function createCommand(): cli.ICommand {
releaseExpoCommand.platform = arg2;

releaseExpoCommand.appStoreVersion = argv["targetBinaryVersion"] as any;
releaseExpoCommand.buildNumber = argv["buildNumber"] as any;
releaseExpoCommand.bundleName = argv["bundleName"] as any;
releaseExpoCommand.deploymentName = argv["deploymentName"] as any;
releaseExpoCommand.disabled = argv["disabled"] as any;
Expand Down Expand Up @@ -1542,6 +1587,7 @@ export function createCommand(): cli.ICommand {
releaseBinaryCommand.targetBinary = arg3;
releaseBinaryCommand.deploymentName = argv["deploymentName"] as any;
releaseBinaryCommand.appStoreVersion = argv["targetBinaryVersion"] as any;
releaseBinaryCommand.buildNumber = argv["buildNumber"] as any;
releaseBinaryCommand.initial = true;
releaseBinaryCommand.disabled = true;
releaseBinaryCommand.mandatory = false;
Expand Down
5 changes: 3 additions & 2 deletions script/management-sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,9 @@ class AccountManager {
return this.get(urlEncode([`/apps/${appName}/deployments/${deploymentName}`])).then((res: JsonResponse) => res.body.deployment);
}

public getBaseRelease(appName: string, deploymentName: string, appVerison: string): Promise<BaseRelease> {
return this.get(urlEncode([`/apps/${appName}/deployments/${deploymentName}/basebundle?appVersion=${appVerison}`])).then(
public getBaseRelease(appName: string, deploymentName: string, appVersion: string, buildNumber?: string): Promise<BaseRelease> {
const qs = buildNumber ? `?appVersion=${appVersion}&buildNumber=${buildNumber}` : `?appVersion=${appVersion}`;
return this.get(urlEncode([`/apps/${appName}/deployments/${deploymentName}/basebundle${qs}`])).then(
(res: JsonResponse) => res.body.basebundle
);
}
Expand Down
4 changes: 2 additions & 2 deletions script/react-native-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from "fs";
import * as chalk from "chalk";
import * as path from "path";
import * as childProcess from "child_process";
import { coerce, compare, valid } from "semver";
import { coerce, compare, gte, valid } from "semver";
import { downloadBlob, extractIPA, fileDoesNotExistOrIsDirectory } from "./utils/file-utils";
import * as dotenv from "dotenv";
import { DotenvParseOutput } from "dotenv";
Expand Down Expand Up @@ -54,7 +54,7 @@ export async function takeHermesBaseBytecode(
outputFolder: string,
bundleName: string
): Promise<string | null> {
const { bundleBlobUrl } = await sdk.getBaseRelease(command.appName, command.deploymentName, command.appStoreVersion);
const { bundleBlobUrl } = await sdk.getBaseRelease(command.appName, command.deploymentName, command.appStoreVersion, command.buildNumber);
if (!bundleBlobUrl) {
return null;
}
Expand Down
2 changes: 2 additions & 0 deletions script/types/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export interface IPackageInfo {
export interface IPatchCommand extends ICommand, IPackageInfo {
appName: string;
appStoreVersion?: string;
buildNumber?: string | null;
deploymentName: string;
label: string;
}
Expand All @@ -184,6 +185,7 @@ export interface IRegisterCommand extends ICommand {
export interface IReleaseBaseCommand extends ICommand, IPackageInfo {
appName: string;
appStoreVersion: string;
buildNumber?: string;
deploymentName: string;
noDuplicateReleaseError?: boolean;
privateKeyPath?: string;
Expand Down
1 change: 1 addition & 0 deletions script/types/rest-definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export interface DownloadReport {
/*inout*/
export interface PackageInfo {
appVersion?: string;
buildNumber?: string | null;
description?: string;
isDisabled?: boolean;
isMandatory?: boolean;
Expand Down