Skip to content

Commit c194a75

Browse files
authored
Merge pull request #5 from JeschkeLab/main-1
Refactor PyPI upload workflow for tag publishing
2 parents 06dc23f + e8d4f54 commit c194a75

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

.github/workflows/PyPI_upload.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ on:
55
branches:
66
- release/*
77

8-
98
jobs:
109
build:
1110
name: Build distribution 📦
@@ -33,19 +32,19 @@ jobs:
3332
name: python-package-distributions
3433
path: dist/
3534

36-
publish-to-testpypi:
37-
name: Publish Python 🐍 distribution 📦 to PyPI
35+
publish-to-pypi:
36+
name: >-
37+
Publish Python 🐍 distribution 📦 to PyPI
38+
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
3839
needs:
3940
- build
4041
runs-on: ubuntu-latest
41-
4242
environment:
4343
name: pypi
44-
url: https://pypi.org/p/PyEPR-ESR
45-
44+
url: https://pypi.org/p/PyEPR-ESR # Replace <package-name> with your PyPI project name
4645
permissions:
4746
id-token: write # IMPORTANT: mandatory for trusted publishing
48-
47+
4948
steps:
5049
- name: Download all the dists
5150
uses: actions/download-artifact@v4
@@ -56,4 +55,4 @@ jobs:
5655
uses: pypa/gh-action-pypi-publish@release/v1
5756
with:
5857
verbose: true
59-
repository-url: https://pypi.org/legacy/
58+

0 commit comments

Comments
 (0)