Ship-step contract for pipelines: uniform exit codes (0/1/2/3/4/7) in cli/lib/ship-step.ts, one final --json line, --result-file (atomic, also on failure), --progress json, --env-file with secret redaction, --version-from; idempotent play upload / apple upload / play release / apple submit re-runs end with exit 7; play upload takes --track production and --version-code

This commit is contained in:
CRTkafa 2026-10-23 13:13:21 +08:00
parent 4eac8e8cd8
commit 06a0b424f5
14 changed files with 928 additions and 24 deletions

View file

@ -471,12 +471,17 @@ describe('CLI dry runs (no store access)', () => {
expect(r.stderr.toString()).toContain("Use in defaultConfig of android/app/build.gradle: versionCode((project.findProperty('versionCode') ?: 1) as Integer)");
expect(existsSync(join(d, 'build/android/com.example.game-1.aab'))).toBe(false);
});
test('play upload refuses production', () => {
test('play upload: an unknown track is a usage error; under the ship contract exit 2 with one JSON line', () => {
const d = project('cli-up');
writeFileSync(join(d, 'app.aab'), makeAab('com.example.game', 3));
const r = cli(d, ['play', 'upload', 'app.aab', '--track', 'production', '--dry']);
expect(r.exitCode).toBe(1);
expect(r.stderr.toString()).toContain('testing tracks');
const plain = cli(d, ['play', 'upload', 'app.aab', '--track', 'nightly', '--dry']);
expect(plain.exitCode).toBe(1);
expect(plain.stderr.toString()).toContain('--track: internal | alpha | beta | production');
const r = cli(d, ['play', 'upload', 'app.aab', '--track', 'nightly', '--dry', '--json']);
expect(r.exitCode).toBe(2);
const lines = r.stdout.toString().trim().split('\n');
expect(lines).toHaveLength(1);
expect(JSON.parse(lines[0]!)).toMatchObject({ ok: false, step: 'upload', store: 'play', error: { code: 'USAGE' } });
});
});