Skip to content

Commit

Permalink
get version from env
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Taubert committed Aug 1, 2022
1 parent 22714df commit c288797
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
permissions:
contents: read

env:
RELEASE_TAG: ${{ github.event.release.tag_name }}


jobs:
deploy:

Expand Down
16 changes: 15 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@
Configuration for building the pip package
"""

import os
from setuptools import setup

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


def get_version(default :str ):
""" retrieve version number from environment variable """
version = os.getenv('RELEASE_TAG')
if version is None:
print("no version passed")
return default

print(version)
version = version.replace("v", "")
return version


setup(
name='uiipythonapi',
version='1.0.0',
version=get_version("1.0.0"),
url='https://github.com/virtomize/uii-python-api',
author='Virtomize GmbH',
author_email='[email protected]',
Expand Down

0 comments on commit c288797

Please sign in to comment.