From 2ae6e74bf3c9b45368f78373776b0028b50479d3 Mon Sep 17 00:00:00 2001 From: Aymeric Galan Date: Wed, 17 Apr 2024 12:29:19 +0200 Subject: [PATCH] Triggers testpypi upload only for tags as well --- .github/workflows/publish-package.yml | 7 ++++--- setup.py | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 48d11bd..4e5505d 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -33,13 +33,13 @@ jobs: publish-to-pypi: name: >- Publish distribution to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes + if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes (15 MIN DELAY using pypi github deployment) needs: - build runs-on: ubuntu-latest environment: name: pypi - url: https://pypi.org/p/coolest # Replace with your PyPI project name + url: https://pypi.org/p/coolest permissions: id-token: write # IMPORTANT: mandatory for trusted publishing @@ -96,7 +96,8 @@ jobs: --repo '${{ github.repository }}' publish-to-testpypi: - name: Publish distribution to TestPyPI # unlike for PyPI, releases on any push on TestPyPI + name: Publish distribution to TestPyPI + if: startsWith(github.ref, 'refs/tags/') # only publish to TestPyPI on tag pushes (NO DELAY using testpypi github deployment) needs: - build runs-on: ubuntu-latest diff --git a/setup.py b/setup.py index 065a04f..6e88b37 100644 --- a/setup.py +++ b/setup.py @@ -34,12 +34,15 @@ 'getdist>=1.3.2', # for making corner plots ] +version = release_info['__version__'] + setuptools.setup( name=name, author=release_info['__author__'], author_email=release_info['__email__'], - version=release_info['__version__'], + version=version, url=release_info['__url__'], + download_url=f"https://github.com/aymgal/coolest/archive/refs/tags/v{version}.tar.gz", packages=setuptools.find_packages(), license=release_info['__license__'], description=release_info['__about__'],