From 4705d88933a7e56d0da1a1e7f377ba04236e6a97 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sat, 28 Nov 2026 00:45:52 +0100 Subject: [PATCH] fix(native-release): let a held back APK go out by hand from its release tag A run started by hand on a release tag publishes too, so a build held back while its server was not released yet can follow once it is. --- scripts/ci/android-apk-release.mjs | 7 +++++-- scripts/ci/android-apk-release.test.mjs | 3 ++- wiki/Native-Apps.md | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/ci/android-apk-release.mjs b/scripts/ci/android-apk-release.mjs index 19dd3f412..87b1def66 100644 --- a/scripts/ci/android-apk-release.mjs +++ b/scripts/ci/android-apk-release.mjs @@ -55,9 +55,12 @@ export function mayPublish(appMinimum, released) { return released >= appMinimum; } -/** Whether the run was started by pushing a release tag, not a prerelease tag or by hand. */ +/** + * Whether the run builds a release tag: pushed, or started by hand on that tag + * to publish an APK held back at the release. Never a prerelease tag or a branch. + */ export function isReleaseRun(eventName, ref) { - return eventName === 'push' && /^refs\/tags\/v\d+\.\d+\.\d+$/.test(ref ?? ''); + return ['push', 'workflow_dispatch'].includes(eventName) && /^refs\/tags\/v\d+\.\d+\.\d+$/.test(ref ?? ''); } function guard(releasedFeatures) { diff --git a/scripts/ci/android-apk-release.test.mjs b/scripts/ci/android-apk-release.test.mjs index 40798b46a..ef1bfa8cf 100644 --- a/scripts/ci/android-apk-release.test.mjs +++ b/scripts/ci/android-apk-release.test.mjs @@ -31,7 +31,8 @@ describe('android-apk-release', () => { assert.equal(isReleaseRun('push', 'refs/tags/v5.2.2'), true); assert.equal(isReleaseRun('push', 'refs/tags/v5.2.2-tf.1'), false); assert.equal(isReleaseRun('push', 'refs/heads/dev'), false); - assert.equal(isReleaseRun('workflow_dispatch', 'refs/tags/v5.2.2'), false); + assert.equal(isReleaseRun('workflow_dispatch', 'refs/tags/v5.2.2'), true); + assert.equal(isReleaseRun('workflow_dispatch', 'refs/tags/v5.2.2-tf.1'), false); assert.equal(isReleaseRun('workflow_dispatch', 'refs/heads/dev'), false); assert.equal(isReleaseRun('push', undefined), false); }); diff --git a/wiki/Native-Apps.md b/wiki/Native-Apps.md index 9913e1496..d945f08ae 100644 --- a/wiki/Native-Apps.md +++ b/wiki/Native-Apps.md @@ -123,7 +123,7 @@ The apps are built from `client/`: Capacitor wraps the address screen in `client - **Every pull request** that touches the native code runs `.github/workflows/native.yml`: an unsigned Android debug and release build (the release build runs R8 with `client/android/app/proguard-rules.pro`), an iOS simulator build with Xcode 26, and a check of the store texts and images. - **A release** runs `.github/workflows/native-release.yml`, by hand (choose the Play track) or on a `v*` tag. A tag pushed by another workflow with the default token does not start it, so after a release run it by hand on the tag. It builds the signed Android App Bundle and sends it to the chosen Google Play testing track as a draft, and archives the iOS app and uploads it to App Store Connect, where it appears in TestFlight. Promoting a build to production happens in the two consoles. - **Version numbers**: both stores get the version from `client/package.json` without a prerelease suffix, and the workflow run number plus 1000 as the build number. A prerelease reuses its version with a higher build number and stays on the internal track and in TestFlight. -- **The APK outside Google Play**: after the upload, the same job fetches the universal APK Google Play builds of that bundle (signed with the Play app signing key) and publishes it to [liketrek/trek-android](https://github.com/liketrek/trek-android), one release per app version, a newer build of the same version replacing its APK. `scripts/ci/android-apk-release.mjs` holds a build back while the app needs a newer native API than the latest server release answers. +- **The APK outside Google Play**: after the upload, the same job fetches the universal APK Google Play builds of that bundle (signed with the Play app signing key) and publishes it to [liketrek/trek-android](https://github.com/liketrek/trek-android), one release per app version, a newer build of the same version replacing its APK. `scripts/ci/android-apk-release.mjs` publishes only builds of a release tag vX.Y.Z (no TestFlight tags, no branches) and holds one back while the app needs a newer native API than the latest server release answers; a held build goes out later by starting the workflow by hand on its release tag. - **The `store` environment** holds every secret and needs the approval of a required reviewer before a job starts. It only runs in liketrek/TREK, never for a pull request. ### Secrets in the `store` environment