File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 needs : [build_wheels, build_sdist]
7171 runs-on : ubuntu-latest
7272 permissions :
73- id-token : write
7473 contents : read
7574
7675 steps :
8079 path : dist
8180 merge-multiple : true
8281
83- - name : Publish to PyPI
84- uses : pypa/gh-action-pypi-publish@release/v1
82+ - name : Set up Python
83+ uses : actions/setup-python@v5
8584 with :
86- packages-dir : dist
85+ python-version : " 3.12"
86+
87+ - name : Inspect distributions
88+ run : |
89+ set -euo pipefail
90+ find dist -type f -print
91+
92+ - name : Install packaging tools
93+ run : |
94+ python -m pip install --upgrade pip build twine
95+
96+ - name : Validate distribution metadata
97+ run : |
98+ set -euo pipefail
99+ mapfile -t ARTIFACTS < <(find dist -type f \( -name "*.whl" -o -name "*.tar.gz" -o -name "*.zip" \) | sort)
100+ if [ ${#ARTIFACTS[@]} -eq 0 ]; then
101+ echo "No distributions found under dist/"
102+ exit 1
103+ fi
104+ python -m twine check "${ARTIFACTS[@]}"
105+
106+ - name : Publish to PyPI
107+ env :
108+ TWINE_USERNAME : __token__
109+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
110+ run : |
111+ set -euo pipefail
112+ mapfile -t ARTIFACTS < <(find dist -type f \( -name "*.whl" -o -name "*.tar.gz" -o -name "*.zip" \) | sort)
113+ python -m twine upload --non-interactive --skip-existing "${ARTIFACTS[@]}"
You can’t perform that action at this time.
0 commit comments