- validate: read-only App Store Connect + Play report with ordered blockers (exit 1) - apple release --phased on|pause|resume|complete and --manual-release (asks first) - apple status --wait-review (exit 0 approved, 1 rejected, 7 timeout), apple next-build, apple encryption - play rollout --fraction|--halt|--resume|--complete, play next-version-code - check --aso, whats-new --since <tag>, privacy-manifest --ios <path>, version - Apple IAP description limit is 45 characters (App Store Connect Help), not 55 - config: apple.usesNonExemptEncryption, apple.screenshotTypes, ads.appAdsTxt
24 lines
1.5 KiB
TypeScript
24 lines
1.5 KiB
TypeScript
// Next Play versionCode: one above every code in uploaded bundles and on any track. Read-only (the edit is deleted).
|
|
// Prints only the number on stdout:
|
|
// storebound play next-version-code -> 43
|
|
// ./gradlew bundleRelease -PversionCode=$(storebound play next-version-code)
|
|
import type { Ctx } from '../lib/ctx';
|
|
import { need } from '../lib/ctx';
|
|
import { nextVersionCode } from '../lib/release';
|
|
import { playClient } from './client';
|
|
|
|
export async function run(ctx: Ctx): Promise<void> {
|
|
const { config, root } = ctx.loaded;
|
|
const play = await playClient(root, need(config.play?.packageName, 'play.packageName'));
|
|
const e = await play.call<{ id: string }>('POST', `${play.API}/edits`, {});
|
|
try {
|
|
const bundles = (await play.call<{ bundles?: { versionCode: number }[] }>('GET', `${play.API}/edits/${e.id}/bundles`)).bundles ?? [];
|
|
const apks = (await play.call<{ apks?: { versionCode: number }[] }>('GET', `${play.API}/edits/${e.id}/apks`).catch(() => ({ apks: [] }))).apks ?? [];
|
|
const tracks = (await play.call<{ tracks?: { releases?: { versionCodes?: string[] }[] }[] }>('GET', `${play.API}/edits/${e.id}/tracks`)).tracks ?? [];
|
|
const codes = [...bundles.map(b => b.versionCode), ...apks.map(a => a.versionCode), ...tracks.flatMap(t => (t.releases ?? []).flatMap(r => r.versionCodes ?? []))];
|
|
console.error(`[play] ${codes.length} version codes seen; next versionCode:`);
|
|
console.log(nextVersionCode(codes));
|
|
} finally {
|
|
await play.call('DELETE', `${play.API}/edits/${e.id}`).catch(() => {});
|
|
}
|
|
}
|