1919 steps :
2020 - uses : actions/checkout@v4
2121
22+ - name : Debug workflow context
23+ run : |
24+ echo "Event name: ${{ github.event_name }}"
25+ echo "Event action: ${{ github.event.action }}"
26+ echo "Publish to PyPI input: ${{ inputs.publish_to_pypi }}"
27+ echo "Release published: ${{ github.event_name == 'release' && github.event.action == 'published' }}"
28+
2229 - name : Set up Python
23- uses : actions/setup-python@v4
30+ uses : actions/setup-python@v5
2431 with :
2532 python-version : " 3.x"
2633
@@ -33,14 +40,14 @@ jobs:
3340 run : python -m build
3441
3542 - name : Upload distribution artifacts
36- uses : actions/upload-artifact@v3
43+ uses : actions/upload-artifact@v4
3744 with :
3845 name : python-package-distributions
3946 path : dist/
4047
4148 publish-to-pypi :
4249 name : Publish to PyPI
43- if : github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.event. inputs.publish_to_pypi == ' true' )
50+ if : ( github.event_name == 'release' && github.event.action == 'published') || (github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi == true)
4451 needs : build
4552 runs-on : ubuntu-latest
4653
4956
5057 steps :
5158 - name : Download distribution artifacts
52- uses : actions/download-artifact@v3
59+ uses : actions/download-artifact@v4
5360 with :
5461 name : python-package-distributions
5562 path : dist/
5966
6067 publish-to-testpypi :
6168 name : Publish to TestPyPI
62- if : github.event_name == 'workflow_dispatch' && github.event. inputs.publish_to_pypi == ' false'
69+ if : github.event_name == 'workflow_dispatch' && inputs.publish_to_pypi == false
6370 needs : build
6471 runs-on : ubuntu-latest
6572
6875
6976 steps :
7077 - name : Download distribution artifacts
71- uses : actions/download-artifact@v3
78+ uses : actions/download-artifact@v4
7279 with :
7380 name : python-package-distributions
7481 path : dist/
0 commit comments