Skip to content

Commit

Permalink
Triggers testpypi upload only for tags as well
Browse files Browse the repository at this point in the history
  • Loading branch information
aymgal committed Apr 17, 2024
1 parent babe678 commit 2ae6e74
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <package-name> with your PyPI project name
url: https://pypi.org/p/coolest
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

Expand Down Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__'],
Expand Down

0 comments on commit 2ae6e74

Please sign in to comment.