apple: release type (apple.releaseType, apple release --after-approval|--manual), device-family preflight, TestFlight invite needs an installable build
This commit is contained in:
parent
4763862178
commit
85cf494c0a
24 changed files with 899 additions and 18 deletions
|
|
@ -69,7 +69,7 @@ export const versionInfos = (rows: { id: string; attributes: Record<string, unkn
|
|||
* string changes only while PREPARE_FOR_SUBMISSION), create a new one, or refuse (the number exists, is not higher than
|
||||
* a version that went through review, or another version is in review / pending release). Pure.
|
||||
*/
|
||||
export function planVersion(rows: { id: string; attributes: Record<string, unknown> }[], want: string, attrs: { copyright: string; releaseType: string }, platform = 'IOS'): VersionPlan {
|
||||
export function planVersion(rows: { id: string; attributes: Record<string, unknown> }[], want: string, attrs: { copyright: string; releaseType?: string; earliestReleaseDate?: string }, platform = 'IOS'): VersionPlan {
|
||||
const existing = versionInfos(rows);
|
||||
const editable = existing.find(v => EDITABLE_STATES.has(v.state));
|
||||
const others = existing.filter(v => v !== editable);
|
||||
|
|
@ -87,7 +87,8 @@ export function planVersion(rows: { id: string; attributes: Record<string, unkno
|
|||
return refuse(`version ${want} is not higher than ${higher.versionString} (${higher.state}); App Store versions only go up`);
|
||||
if (editable) {
|
||||
const cur = rows.find(r => r.id === editable.id)!.attributes;
|
||||
const wantAttrs = { versionString: want, copyright: attrs.copyright, releaseType: attrs.releaseType };
|
||||
// releaseType only when asked for (apple.releaseType): an existing version keeps the one it has
|
||||
const wantAttrs: Record<string, string | undefined> = { versionString: want, copyright: attrs.copyright, releaseType: attrs.releaseType, earliestReleaseDate: attrs.releaseType === 'SCHEDULED' ? attrs.earliestReleaseDate : undefined };
|
||||
const p = planItem(editable.id, { id: editable.id, attributes: cur }, wantAttrs);
|
||||
if (editable.versionString !== want && editable.state !== 'PREPARE_FOR_SUBMISSION')
|
||||
return refuse(`the editable version ${editable.versionString} is ${editable.state}; its version string changes only while PREPARE_FOR_SUBMISSION (use --version ${editable.versionString}, or change it in App Store Connect)`);
|
||||
|
|
@ -102,7 +103,8 @@ export function planVersion(rows: { id: string; attributes: Record<string, unkno
|
|||
if (busy) return refuse(`version ${busy.versionString} is ${busy.state}; App Store Connect allows one version in progress (${busy.state === 'PENDING_DEVELOPER_RELEASE'
|
||||
? `release it first: storebound apple release --manual-release --version ${busy.versionString} --dry, then without --dry`
|
||||
: busy.state === 'WAITING_FOR_REVIEW' || busy.state === 'IN_REVIEW' ? 'wait for the review, or remove it from review in App Store Connect' : 'wait for its release or remove it from review'})`);
|
||||
const attributes = { platform, versionString: want, copyright: attrs.copyright, releaseType: attrs.releaseType };
|
||||
const attributes: Record<string, string> = { platform, versionString: want, copyright: attrs.copyright, releaseType: attrs.releaseType ?? 'MANUAL' };
|
||||
if (attributes.releaseType === 'SCHEDULED' && attrs.earliestReleaseDate) attributes.earliestReleaseDate = attrs.earliestReleaseDate;
|
||||
return { ...base, action: 'create', reason: `create version ${want} (no editable ${PLATFORM_LABEL[platform] ?? platform} version)`, changes: Object.entries(attributes).map(([field, to]) => ({ field, from: null, to })), attributes };
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue