storebound/cli/apple/next-build.ts
CRT 1fc94da443 CLI: store readiness, release management, export compliance, ASO audit, release notes, privacy manifest scan
- 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
2026-10-10 21:02:55 +08:00

19 lines
1.1 KiB
TypeScript

// Next safe build number (CFBundleVersion) from App Store Connect: one above the highest build ever uploaded for the
// app, across every version train. Prints only the number on stdout, so scripts can use it:
// storebound apple next-build -> 42
// xcodebuild ... CURRENT_PROJECT_VERSION=$(storebound apple next-build)
// Then attach exactly that build: storebound apple listing --version x.y.z --build 42 (never "the latest").
import type { Ctx } from '../lib/ctx';
import { need } from '../lib/ctx';
import { nextBuildNumber } from '../lib/release';
import { ascClient } from './asc';
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)));
console.error(`[apple] ${builds.length} builds on App Store Connect; next build number:`);
console.log(next);
}