Skip to content

The swiss army knife of lossless video/audio editing

Use separate App Store version numbering in storeRelease

Mikael Finstad2b75d21486ca
diff --git a/AGENTS.md b/AGENTS.md
index 452f64c1..8a8b4ca2 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -20,7 +20,7 @@ Only the bundled FFmpeg version (`script/downloadFfmpeg.ts`) is supported. Don't
## Store release notes
-The stores lag behind GitHub releases, so their "What's new" text must cover every version since the one currently live in that store. Ask which version that is (Mac App Store: App Store Connect; Microsoft Store: Partner Center → the product's current submission → Packages), then combine `versions/*.md` after it up to the version being released.
+The stores lag behind GitHub releases, so their "What's new" text must cover every version since the one currently live in that store. Ask which version that is (Mac App Store: App Store Connect; Microsoft Store: Partner Center → the product's current submission → Packages), then combine `versions/*.md` after it up to the version being released. Mac App Store versions have their own numbering (1.x); the GitHub version is that of the build attached to it.
- Write for customers: lead with the most impactful new features and visible fixes. Leave out internals (dependency/FFmpeg upgrades, security fixes, refactors) and niche power-user details; they're covered by a final "Many other improvements and fixes". The longer since the last store release, the more of the interesting changes can be included.
- Plain text, no Markdown, code formatting, issue references or links. Use plain-language feature names instead of internal action/variable names.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 73178592..85bf7fe0 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -132,7 +132,7 @@ node script/storeRelease.ts msstore x.y.z # dry run
node script/storeRelease.ts msstore x.y.z --submit
```
-- **Mac App Store**: creates the version (or reuses the editable one), waits for the build to finish processing and attaches it, sets en-US "What's New", manual release, 7-day phased release, and submits for review. Once approved, release it manually in App Store Connect.
+- **Mac App Store**: App Store versions have their own numbering (1.x, e.g. 1.14), separate from the GitHub/build version (`package.json`, e.g. 3.70.1), which is the build attached to it. The script takes the build version, and creates the next App Store version (1.14 → 1.15) or reuses the editable one. It waits for the build to finish processing and attaches it, sets en-US "What's New", manual release, 7-day phased release, and submits for review. Once approved, release it manually in App Store Connect.
- **Microsoft Store**: creates a submission, adds both `.appx` packages from the GitHub release (renamed without `-DONT-USE-THIS-FILE`), sets en-US "What's new", gradual rollout at 0%, "Don't publish until I select Publish now", and submits for certification. Once certified, click "Publish now" in Partner Center, then increase the rollout with `node script/storeRelease.ts msstore-rollout <percent> --submit` (dry run without `--submit`; `100` finalizes it). Don't edit a submission in Partner Center that the script created, or the API can no longer change it.
- Description, keywords and screenshots are not touched; update them by hand if needed.
@@ -164,7 +164,7 @@ Set these in your shell (never commit them). Secrets can be kept in the macOS ke
Tag builds already upload the build to App Store Connect (`(MacOS) Upload to Mac App Store` in `build.yml`).
-1. In [App Store Connect](https://appstoreconnect.apple.com/apps/1505323402/distribution), create a new version
+1. In [App Store Connect](https://appstoreconnect.apple.com/apps/1505323402/distribution), create a new version, numbered after the previous App Store version (e.g. 1.14 → 1.15), not the GitHub version
2. "Build": click "Add Build" and pick the build of this version
3. Update "What's New in This Version" (see [Store release notes](./AGENTS.md#store-release-notes)). If needed, also update "Description" and screenshots
4. "App Store Version Release": tick "Manually release this version"
diff --git a/script/storeRelease.ts b/script/storeRelease.ts
index 2183346c..8958adaa 100644
--- a/script/storeRelease.ts
+++ b/script/storeRelease.ts
@@ -112,18 +112,28 @@ async function mas(version: string) {
const app = await asc('GET', `/v1/apps/${masAppId}`);
log(`App: ${app?.attributes['name']} (${app?.attributes['bundleId']})`);
- const versions = (await asc<AscResource[]>('GET', `/v1/apps/${masAppId}/appStoreVersions?filter[platform]=MAC_OS&limit=10`))!
+ // App Store versions have their own numbering (1.x), independent of the build (package.json) version
+ const versions = (await asc<AscResource[]>('GET', `/v1/apps/${masAppId}/appStoreVersions?filter[platform]=MAC_OS&limit=200`))!
.toSorted((a, b) => String(b.attributes['createdDate']).localeCompare(String(a.attributes['createdDate'])));
- log('Latest macOS versions:');
- for (const v of versions.slice(0, 5)) log(` ${v.attributes['versionString']}: ${v.attributes['appVersionState']}, release type ${v.attributes['releaseType']}`);
-
- // Only one version can be editable at a time, so reuse it (renaming it if needed)
- const editable = versions.find((v) => ['PREPARE_FOR_SUBMISSION', 'DEVELOPER_REJECTED', 'REJECTED', 'METADATA_REJECTED', 'INVALID_BINARY'].includes(String(v.attributes['appVersionState'])));
- const existing = versions.find((v) => v.attributes['versionString'] === version);
- assert(!existing || existing === editable, `Version ${version} already exists and is not editable (${existing?.attributes['appVersionState']})`);
+ log('Latest App Store versions:');
+ for (const v of versions.slice(0, 3)) log(` ${v.attributes['versionString']}: ${v.attributes['appVersionState']}`);
let build = await findMasBuild(version);
log(`Build ${version}: ${build ? `${build.attributes['processingState']}, uploaded ${build.attributes['uploadedDate']}` : 'not uploaded yet'}`);
+
+ // Only one version can be editable at a time, so reuse it
+ const isEditable = (v: AscResource) => ['PREPARE_FOR_SUBMISSION', 'DEVELOPER_REJECTED', 'REJECTED', 'METADATA_REJECTED', 'INVALID_BINARY'].includes(String(v.attributes['appVersionState']));
+ const editable = versions.find((v) => isEditable(v));
+ const attachedTo = build && await asc('GET', `/v1/builds/${build.id}/appStoreVersion`);
+ if (attachedTo && !isEditable(attachedTo)) {
+ log(`Build ${version} is already in App Store version ${attachedTo.attributes['versionString']} (${attachedTo.attributes['appVersionState']}), nothing to do`);
+ return;
+ }
+ const inFlight = versions.find((v) => ['WAITING_FOR_REVIEW', 'IN_REVIEW', 'READY_FOR_REVIEW', 'ACCEPTED', 'PENDING_DEVELOPER_RELEASE', 'PENDING_APPLE_RELEASE', 'PROCESSING_FOR_DISTRIBUTION'].includes(String(v.attributes['appVersionState'])));
+ assert(editable || !inFlight, `App Store version ${inFlight?.attributes['versionString']} is ${inFlight?.attributes['appVersionState']}; release it (or remove it from review) before creating a new version`);
+ const [major, minor] = String(versions[0]!.attributes['versionString']).split('.').map(Number);
+ const versionString = editable ? String(editable.attributes['versionString']) : `${major}.${minor! + 1}`;
+
if (write) {
for (let i = 0; build?.attributes['processingState'] !== 'VALID'; i += 1) {
assert(build == null || build.attributes['processingState'] === 'PROCESSING', `Build ${version} is ${build?.attributes['processingState']}`);
@@ -137,16 +147,15 @@ async function mas(version: string) {
}
let versionId: string;
- const attributes = { versionString: version, releaseType: 'MANUAL' };
+ const attributes = { versionString, releaseType: 'MANUAL' };
if (editable) {
- log(`Editable version: ${editable.attributes['versionString']}`);
- plan(`update version ${editable.attributes['versionString']}: ${JSON.stringify(attributes)}, build ${version}`);
+ plan(`update the editable App Store version ${versionString}: manual release, build ${version}`);
if (write) {
await asc('PATCH', `/v1/appStoreVersions/${editable.id}`, { type: 'appStoreVersions', id: editable.id, attributes, relationships: { build: ref('builds', build!.id) } });
}
versionId = editable.id;
} else {
- plan(`create version ${version}: ${JSON.stringify(attributes)}, build ${version}`);
+ plan(`create App Store version ${versionString}: manual release, build ${version}`);
if (!write) {
plan('set en-US What\'s New, enable 7-day phased release, submit for review');
return;