upload --pre-check/--evidence, shots copy translate, game-center --locale-map, play games API-disabled hint

This commit is contained in:
CRTkafa 2026-10-24 12:10:23 +08:00
parent 29a9683ab7
commit 8ffa27d4f8
24 changed files with 598 additions and 27 deletions

View file

@ -59,7 +59,7 @@ type Fields = Partial<Pick<ShipResult, 'track' | 'version' | 'build' | 'state' |
interface Run {
key: string; step: string; store: 'apple' | 'play';
progress: boolean;
fields: Fields; noop: boolean; warnings: string[]; detail?: unknown; declined?: string;
fields: Fields; extra?: Record<string, unknown>; noop: boolean; warnings: string[]; detail?: unknown; declined?: string;
}
const RUN = Symbol.for('storebound.shipRun');
const g = globalThis as unknown as Record<symbol, Run | null | undefined>;
@ -69,6 +69,8 @@ export const shipRun = (): Run | null => g[RUN] ?? null;
/** What the command did: fields of the final result (later calls overwrite earlier ones). */
export function shipReport(f: Fields): void { const r = shipRun(); if (r) Object.assign(r.fields, Object.fromEntries(Object.entries(f).filter(([, v]) => v !== undefined))); }
/** Extra keys of the final result (e.g. the preCheck evidence), kept also when the step fails. */
export function shipExtra(x: Record<string, unknown>): void { const r = shipRun(); if (r) r.extra = { ...r.extra, ...x }; }
/** Nothing to do (the build is on the store already, the release is there): exit 7 with what is there. */
export function shipNoop(f: Fields = {}): void { const r = shipRun(); if (r) { r.noop = true; shipReport(f); } }
/** A warning for the result's warnings[] (the log line is the command's own). */
@ -178,7 +180,7 @@ export function buildResult(run: Run, exit: ShipExitCode, error?: ShipErrorInfo)
...(f.artifact ? { artifact: f.artifact } : {}),
...(error ? { error } : {}),
};
return { ...out, ...Object.fromEntries(Object.entries(own).filter(([k]) => !(k in out) && !CONTRACT_KEYS.has(k))) } as ShipResult & Record<string, unknown>;
return { ...out, ...(run.extra ?? {}), ...Object.fromEntries(Object.entries(own).filter(([k]) => !(k in out) && !CONTRACT_KEYS.has(k))) } as ShipResult & Record<string, unknown>;
}
const CONTRACT_KEYS = new Set(['ok', 'step', 'store', 'track', 'version', 'build', 'state', 'url', 'warnings', 'artifact', 'error']);