File tree Expand file tree Collapse file tree 1 file changed +1
-30
lines changed
Expand file tree Collapse file tree 1 file changed +1
-30
lines changed Original file line number Diff line number Diff line change 11name : Publish Python Package
22
33# Trigger on:
4- # - pull requests targeting main (publish to TestPyPI for validation before merge)
54# - pushes to main (publish to PyPI after merge)
6- # - published GitHub Releases (keep existing behavior for canonical releases)
5+ # - published GitHub Releases (publish to PyPI for versioned releases)
76on :
8- pull_request :
9- branches : [main]
107 push :
118 branches : [main]
129 release :
4441 name : python-package-distributions
4542 path : dist/
4643
47- # Publish from pull requests to main -> TestPyPI
48- publish_testpypi :
49- name : Publish to TestPyPI (PR to main)
50- runs-on : ubuntu-latest
51- needs : build_sdist_and_wheel
52- # Only run for pull request events targeting main
53- if : github.event_name == 'pull_request' && github.base_ref == 'main'
54- environment : testpypi
55- permissions :
56- id-token : write
57- contents : read
58-
59- steps :
60- - name : Download dists
61- uses : actions/download-artifact@v4
62- with :
63- name : python-package-distributions
64- path : dist/
65-
66- - name : Publish package distributions to TestPyPI
67- uses : pypa/gh-action-pypi-publish@release/v1
68- with :
69- # repository-url directs upload to TestPyPI
70- repository-url : https://test.pypi.org/legacy/
71- skip-existing : true
72-
7344 # Publish from pushes to main OR when a Release is published -> Production PyPI
7445 publish_pypi :
7546 name : Publish to PyPI (main branch or GitHub Release)
You can’t perform that action at this time.
0 commit comments