Skip to content

Commit 31fa13b

Browse files
committed
set up setup.py to get version from env
1 parent 96f5c63 commit 31fa13b

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.github/workflows/on_tag_release.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ jobs:
2222
- uses: actions/setup-python@v2
2323
with:
2424
python-version: '3.8'
25+
- name: Get Tag Version
26+
id: vars
27+
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/}
2528
- name: Create Distribution Package
29+
env:
30+
RELEASE_VERSION: ${{ steps.vars.outputs.tag }}
2631
run: python setup.py sdist
2732
- name: Publish package
2833
uses: pypa/gh-action-pypi-publish@release/v1

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
Setup module
66
'''
7+
import os
78
import setuptools
89

910
with open('README.md', 'r') as fh:
@@ -13,8 +14,7 @@
1314
REQS = fin.read().splitlines()
1415

1516
setuptools.setup(
16-
setup_requires=['setuptools-git-version'],
17-
version_format='{tag}',
17+
version=os.environ.get('RELEASE_VERSION'),
1818
name='fastapi-router-controller',
1919
author='Pasquale Carmine Carbone',
2020
author_email='[email protected]',

0 commit comments

Comments
 (0)