Skip to content

Commit 38b7611

Browse files
authored
Update publish.yml to use trusted publishers
1 parent c9c60d5 commit 38b7611

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/publish.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
- uses: actions/checkout@v4
1818
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v4
19+
uses: actions/setup-python@v5
2020
with:
2121
python-version: ${{ matrix.python-version }}
2222
cache: pip
@@ -30,22 +30,22 @@ jobs:
3030
deploy:
3131
runs-on: ubuntu-latest
3232
needs: [test]
33+
environment: release
34+
permissions:
35+
id-token: write
3336
steps:
3437
- uses: actions/checkout@v4
3538
- name: Set up Python
36-
uses: actions/setup-python@v4
39+
uses: actions/setup-python@v5
3740
with:
3841
python-version: "3.12"
3942
cache: pip
4043
cache-dependency-path: pyproject.toml
4144
- name: Install dependencies
4245
run: |
43-
pip install setuptools wheel twine build
44-
- name: Publish
45-
env:
46-
TWINE_USERNAME: __token__
47-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
46+
pip install setuptools wheel build
47+
- name: Build
4848
run: |
4949
python -m build
50-
twine upload dist/*
51-
50+
- name: Publish
51+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)