Skip to content

Commit 9edb926

Browse files
committed
Use Trusted Publisher
1 parent 7d3d4f9 commit 9edb926

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,40 @@ jobs:
3636
python -m mkdocs gh-deploy -v --clean --remote-name gh-token
3737
git push gh-token gh-pages
3838
39-
pypi:
39+
build:
4040
runs-on: ubuntu-latest
4141

4242
steps:
4343
- uses: actions/checkout@v4
4444
- uses: actions/setup-python@v5
4545
with:
46-
python-version: '3.13'
47-
- name: Package
46+
python-version: 3.13
47+
- name: Build
4848
run: |
49-
pip install --upgrade build
49+
pip install --upgrade pip build
5050
python -m build -s -w
51-
- name: Publish
51+
- name: Store the distribution packages
52+
uses: actions/upload-artifact@v4
53+
with:
54+
name: python-package-distributions
55+
path: dist/
56+
57+
pypi-publish:
58+
needs:
59+
- build
60+
runs-on: ubuntu-latest
61+
environment: pypi
62+
permissions:
63+
# IMPORTANT: this permission is mandatory for Trusted Publishing
64+
id-token: write
65+
66+
steps:
67+
- name: Download all the dists
68+
uses: actions/download-artifact@v4
69+
with:
70+
name: python-package-distributions
71+
path: dist/
72+
- name: Publish distribution
5273
uses: pypa/gh-action-pypi-publish@release/v1
5374
with:
54-
user: __token__
55-
password: ${{ secrets.PYPI_TOKEN }}
75+
print-hash: true

0 commit comments

Comments
 (0)