Skip to content

Commit 461adc5

Browse files
committed
give setup.py access to two github vars
1 parent 01f63f7 commit 461adc5

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/python-app.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ jobs:
5252
pytest tests/
5353
- run: pip install -U wheel build
5454
- name: Build a binary wheel and a source tarball
55+
env:
56+
GITHUB_REF_TYPE: ${{ github.ref_type }}
57+
GITHUB_REF_NAME: ${{ github.ref_name }}
5558
run: python -m build
5659
- name: Publish package distributions to PyPI
5760
uses: pypa/gh-action-pypi-publish@release/v1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import codecs
33
import os
44

5-
VERSION = '2.1.15b0'
5+
VERSION = ((os.getenv("GITHUB_REF_TYPE") == "tag" and os.getenv("GITHUB_REF_NAME")) or '2.1.15').removeprefix("v").removeprefix("V")
66
DESCRIPTION = 'A Scratch API Wrapper'
77
with open('README.md', encoding='utf-8') as f:
88
LONG_DESCRIPTION = f.read()

0 commit comments

Comments
 (0)