From 829da10cb3fde78f2f48a60a53d2e7ac5d25cf76 Mon Sep 17 00:00:00 2001 From: Jigar-f Date: Mon, 23 Dec 2024 15:25:05 +0530 Subject: [PATCH] Update CI tags to support platform specific version. --- .github/workflows/release.yml | 48 +++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5d711299d..99750d20a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,8 @@ name: Publish releases on: # Triggers the workflow on push when pushing to a version tag push: + branches: + - jigar/update-ci-tags tags: - '*lantern-*' workflow_run: @@ -62,11 +64,8 @@ jobs: run: | import sys, os ref = os.environ.get("GITHUB_REF","") - if "refs/tags/lantern" not in ref: - li = 'lantern-installer-dev' - vf = 'version-android-dev.txt' - version = '9999.99.99-dev' - else: + + if "refs/tags" in ref: tag = ref.strip() if tag.startswith('refs/tags/android-lantern-'): a = tag.replace('refs/tags/android-lantern-', '') @@ -76,29 +75,34 @@ jobs: a = tag.replace('refs/tags/desktop-lantern-', '') else: a = tag.replace('refs/tags/lantern-', '') - parts = a.split('-',1) - suffix = parts[1] if len(parts)>1 else '' - beta = 'beta' in suffix - internal = 'internal' in suffix - if beta: - li = 'lantern-installer-preview' - vf = 'version-android-beta.txt' - version = parts[0] - elif internal: - li = 'lantern-installer-internal' - vf = 'version-android-internal.txt' - version = parts[0] - else: - li = 'lantern-installer' - vf = 'version-android.txt' - version = a + parts = a.split('-', 1) + suffix = parts[1] if len(parts) > 1 else '' + beta = 'beta' in suffix + internal = 'internal' in suffix + + if beta: + li = 'lantern-installer-preview' + vf = 'version-android-beta.txt' + version = parts[0] + elif internal: + li = 'lantern-installer-internal' + vf = 'version-android-internal.txt' + version = parts[0] + else: + li = 'lantern-installer' + vf = 'version-android.txt' + version = parts[0] if len(parts) > 0 else a + else: + li = 'lantern-installer-dev' + vf = 'version-android-dev.txt' + version = '9999.99.99-dev' + print('Setting version to ' + version) print('Setting prefix to ' + li) print('Setting version file to ' + vf) print(f'::set-output name=version::{version}') print(f'::set-output name=prefix::{li}') print(f'::set-output name=version_file::{vf}') - build: uses: ./.github/workflows/build.yml secrets: inherit