From 5d86326ae63a2ae5fbea6999b3a066278e09fdca Mon Sep 17 00:00:00 2001 From: Ben Busby Date: Tue, 31 Aug 2021 09:00:55 -0600 Subject: [PATCH] Append timestamp to TestPyPI build versions This should allow the same "version" to be uploaded for each commit. --- .github/workflows/pypi.yml | 2 ++ setup.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 9b3a63f..decd4d5 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -31,6 +31,8 @@ jobs: with: password: ${{ secrets.TEST_PYPI_API_TOKEN }} repository_url: https://test.pypi.org/legacy/ + env: + DEV_BUILD: 1 - name: Publish distribution to PyPI if: startsWith(github.ref, 'refs/tags') uses: pypa/gh-action-pypi-publish@master diff --git a/setup.py b/setup.py index ce994c7..e9cbf88 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,20 @@ +import os import setuptools +import time long_description = open('README.md', 'r').read() requirements = list(open('requirements.txt', 'r')) +optional_dev_tag = '' +if os.getenv('DEV_BUILD'): + optional_dev_tag = '.dev' + str(int(time.time())) + setuptools.setup( author='Ben Busby', - author_email='benbusby@protonmail.com', + author_email='contact@benbusby.com', name='whoogle-search', - version='0.5.4', + version='0.5.4' + optional_dev_tag, include_package_data=True, install_requires=requirements, description='Self-hosted, ad-free, privacy-respecting metasearch engine',