Skip to content

Commit b057c54

Browse files
author
Agent Zero
committed
ci: Fix PyPI publishing to use API token instead of trusted publishing
1 parent 9c7ebd4 commit b057c54

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

.github/workflows/publish.yml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ jobs:
4242
environment:
4343
name: pypi
4444
url: https://pypi.org/p/localportmanager
45-
permissions:
46-
id-token: write
4745

4846
steps:
4947
- name: Download artifacts
@@ -52,8 +50,22 @@ jobs:
5250
name: dist
5351
path: dist/
5452

55-
- name: Publish to PyPI
56-
uses: pypa/gh-action-pypi-publish@release/v1
53+
- name: Set up Python
54+
uses: actions/setup-python@v5
55+
with:
56+
python-version: '3.11'
57+
58+
- name: Install twine
59+
run: |
60+
python -m pip install --upgrade pip
61+
pip install twine
62+
63+
- name: Publish to PyPI using token
64+
env:
65+
TWINE_USERNAME: __token__
66+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
67+
run: |
68+
twine upload dist/* --skip-existing
5769
5870
publish-github:
5971
needs: build

0 commit comments

Comments
 (0)