Skip to content

Commit ccbf7e6

Browse files
authored
Fix PyPI package upload (#1128)
1 parent 420ce84 commit ccbf7e6

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

Diff for: .github/workflows/pypi.yml

+20-15
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,25 @@ on:
55
types: [published]
66

77
jobs:
8-
deploy:
8+
pypi-publish:
9+
name: upload release to PyPI
910
runs-on: ubuntu-latest
11+
environment: pypi
12+
permissions:
13+
id-token: write
1014
steps:
11-
- uses: actions/checkout@v4
12-
- name: Set up Python
13-
uses: actions/setup-python@v5
14-
with:
15-
python-version: '3.9'
16-
- name: Install dependencies
17-
run: pip install --upgrade pip twine
18-
- name: Build and publish
19-
env:
20-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
21-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
22-
run: |
23-
python -m build
24-
twine upload dist/*
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: '3.9'
21+
22+
- name: Install build tool
23+
run: python -m pip install --upgrade build
24+
25+
- name: Build package
26+
run: python -m build
27+
28+
- name: Publish package distributions to PyPI
29+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)