Skip to content

Commit 9d32fcd

Browse files
committed
Deploy to PyPI with trusted publisher
1 parent 55d2852 commit 9d32fcd

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,23 +30,23 @@ jobs:
3030
pytest
3131
deploy:
3232
runs-on: ubuntu-latest
33+
environment: release
34+
permissions:
35+
id-token: write
3336
needs: [test]
3437
steps:
3538
- uses: actions/checkout@v4
36-
- name: Set up Python ${{ matrix.python-version }}
39+
- name: Set up Python
3740
uses: actions/setup-python@v5
3841
with:
39-
python-version: ${{ matrix.python-version }}
40-
cache: 'pip'
41-
cache-dependency-path: setup.py
42+
python-version: '3.12'
43+
cache: pip
44+
cache-dependency-path: '**/setup.py'
4245
- name: Install dependencies
4346
run: |
44-
pip install setuptools wheel twine build
45-
- name: Publish
46-
env:
47-
TWINE_USERNAME: __token__
48-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
47+
pip install setuptools wheel build
48+
- name: Build
4949
run: |
5050
python -m build
51-
twine upload dist/*
52-
51+
- name: Publish
52+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)