Skip to content

Commit

Permalink
Update CI tags to support platform specific version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jigar-f committed Dec 23, 2024
1 parent eb86b45 commit 829da10
Showing 1 changed file with 26 additions and 22 deletions.
48 changes: 26 additions & 22 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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-', '')
Expand All @@ -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
Expand Down

0 comments on commit 829da10

Please sign in to comment.