@@ -45,32 +45,13 @@ jobs:
4545 name : python-package-distributions
4646 path : dist/
4747
48- publish-to-pypi :
49- name : Publish to PyPI
50- runs-on : ubuntu-latest
51- # only publish to PyPI on tag pushes
52- if : startsWith(github.ref, 'refs/tags/')
53- needs : build
54- permissions :
55- id-token : write
56- environment :
57- name : production
58- url : https://pypi.org/p/${{ env.PROJECT_NAME }}
59- steps :
60- - name : Download all the dists
61- uses : actions/download-artifact@v4
62- with :
63- name : python-package-distributions
64- path : dist/
65-
66- - name : Publish distribution to PyPI
67- uses : pypa/gh-action-pypi-publish@release/v1
6848
6949 publish-to-testpypi :
70- name : Publish to TestPyPI
50+ name : Publish to PyPI (TEST)
7151 needs :
7252 - build
7353 runs-on : ubuntu-latest
54+ if : startsWith(github.ref, 'refs/tags/')
7455 environment :
7556 name : testpypi
7657 url : https://test.pypi.org/p/${{ env.PROJECT_NAME }}
@@ -82,11 +63,34 @@ jobs:
8263 with :
8364 name : python-package-distributions
8465 path : dist/
85- - name : Publish to TestPyPI
66+ - name : Publish
8667 uses : pypa/gh-action-pypi-publish@release/v1
8768 with :
8869 repository-url : https://test.pypi.org/legacy/
8970
71+ publish-to-pypi :
72+ name : Publish to PyPI (PROD)
73+ runs-on : ubuntu-latest
74+ # only publish to PyPI on tag pushes
75+ if : startsWith(github.ref, 'refs/tags/')
76+ needs :
77+ - build
78+ - publish-to-testpypi
79+ permissions :
80+ id-token : write
81+ environment :
82+ name : production
83+ url : https://pypi.org/p/${{ env.PROJECT_NAME }}
84+ steps :
85+ - name : Download all the dists
86+ uses : actions/download-artifact@v4
87+ with :
88+ name : python-package-distributions
89+ path : dist/
90+
91+ - name : Publish
92+ uses : pypa/gh-action-pypi-publish@release/v1
93+
9094 create-release :
9195 name : Create GitHub Release
9296 permissions :
0 commit comments