Skip to content

Commit c288797

Browse files
author
Frank Taubert
committed
get version from env
1 parent 22714df commit c288797

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

.github/workflows/python-publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
permissions:
1616
contents: read
1717

18+
env:
19+
RELEASE_TAG: ${{ github.event.release.tag_name }}
20+
21+
1822
jobs:
1923
deploy:
2024

setup.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,28 @@
22
Configuration for building the pip package
33
"""
44

5+
import os
56
from setuptools import setup
67

78
with open("README.md", "r", encoding="utf-8") as fh:
89
long_description = fh.read()
910

11+
12+
def get_version(default :str ):
13+
""" retrieve version number from environment variable """
14+
version = os.getenv('RELEASE_TAG')
15+
if version is None:
16+
print("no version passed")
17+
return default
18+
19+
print(version)
20+
version = version.replace("v", "")
21+
return version
22+
23+
1024
setup(
1125
name='uiipythonapi',
12-
version='1.0.0',
26+
version=get_version("1.0.0"),
1327
url='https://github.com/virtomize/uii-python-api',
1428
author='Virtomize GmbH',
1529
author_email='[email protected]',

0 commit comments

Comments
 (0)