mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-28 07:30:04 +00:00
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:
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user