Skip to content

Commit f8fb670

Browse files
committed
ci(release): fall back to token-based PyPI publish when PYPI_API_TOKEN is set; keep trusted as default
1 parent e63531a commit f8fb670

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/release-stable.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,17 @@ jobs:
4646
echo "📦 Package contents:"
4747
ls -la dist/
4848
49-
- name: Publish to PyPI
49+
- name: Publish to PyPI (token)
50+
if: ${{ secrets.PYPI_API_TOKEN != '' }}
51+
uses: pypa/gh-action-pypi-publish@release/v1
52+
with:
53+
user: __token__
54+
password: ${{ secrets.PYPI_API_TOKEN }}
55+
print-hash: true
56+
verbose: true
57+
58+
- name: Publish to PyPI (trusted)
59+
if: ${{ secrets.PYPI_API_TOKEN == '' }}
5060
uses: pypa/gh-action-pypi-publish@release/v1
5161
with:
5262
print-hash: true

0 commit comments

Comments
 (0)