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.
This commit is contained in:
Maurice
2026-11-28 00:45:52 +01:00
parent ed134fdef3
commit 4705d88933
3 changed files with 8 additions and 4 deletions
+5 -2
View File
@@ -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) {
+2 -1
View File
@@ -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);
});