Skip to content

Commit 4953415

Browse files
fix github action for publishing
1 parent 2682369 commit 4953415

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

.github/workflows/python-publish.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,23 @@ on:
99

1010
jobs:
1111
deploy:
12+
name: upload release to PyPI
1213
runs-on: ubuntu-latest
13-
14+
permissions:
15+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
1416
steps:
15-
- uses: actions/checkout@v2
16-
- name: Set up Python
17-
uses: actions/setup-python@v2
18-
with:
19-
python-version: "3.x"
20-
- name: Install dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install setuptools wheel twine
24-
- name: Build and publish
25-
env:
26-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
27-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
28-
run: |
29-
python setup.py sdist bdist_wheel
30-
twine upload dist/*
17+
- uses: actions/checkout@v3
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: '3.x'
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install setuptools wheel twine
26+
- name: Build and publish
27+
run: |
28+
python setup.py sdist bdist_wheel
29+
- name: Publish package distributions to PyPI
30+
uses: pypa/gh-action-pypi-publish@release/v1
31+

0 commit comments

Comments
 (0)