validate: macOS versions need Mac screenshots, Play reads survive an ended edit; macOS build numbers across platforms; Mac build prebuild + apple.macAppCheck; signing wording off the Mac; dry flows plan uploads

This commit is contained in:
CRTkafa 2026-11-02 18:16:25 +07:00
parent b1f1b206d3
commit f5da7c9f7a
21 changed files with 519 additions and 57 deletions

View file

@ -7,15 +7,25 @@ import type { Ctx } from '../lib/ctx';
import { need } from '../lib/ctx';
import { printJson } from '../lib/log';
import { nextBuildNumber } from '../lib/release';
import { ascClient } from './asc';
import { ascClient, type Asc } from './asc';
/**
* The one place that computes the next CFBundleVersion: the highest build of the app over EVERY platform (iOS, macOS,
* tvOS, visionOS), every processing state and every page, plus one. CFBundleVersion must be unique across the app
* record's builds, so a platform filter (a macOS build once got a number an uploaded macOS build already had) or a
* missed page gives a number the store refuses. `apple next-build`, `apple build` and `apple build --platform macos`
* (also their dry runs) all call this, so they agree.
*/
export async function appNextBuild(c: Pick<Asc, 'all' | 'app'>): Promise<{ next: string; builds: number }> {
const builds = await c.all(`/v1/builds?filter[app]=${await c.app()}&limit=200&fields[builds]=version`);
return { next: nextBuildNumber(builds.map(b => String(b.attributes.version))), builds: builds.length };
}
export async function run(ctx: Ctx): Promise<void> {
const { config, root } = ctx.loaded;
const c = await ascClient(root, need(config.apple?.bundleId, 'apple.bundleId'), config.apple?.appId);
const appId = await c.app();
const builds = await c.all(`/v1/builds?filter[app]=${appId}&limit=200&fields[builds]=version`);
const next = nextBuildNumber(builds.map(b => String(b.attributes.version)));
if (ctx.args.has('json')) { printJson({ next, builds: builds.length }); return; }
console.error(`[apple] ${builds.length} builds on App Store Connect; next build number:`);
const { next, builds } = await appNextBuild(c);
if (ctx.args.has('json')) { printJson({ next, builds }); return; }
console.error(`[apple] ${builds} builds on App Store Connect; next build number:`);
console.log(next);
}