Skip to content

Commit 40ffe5b

Browse files
committed
Use PyPI trusted publisher
1 parent 3c2a107 commit 40ffe5b

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.github/workflows/deploy.yml

Lines changed: 26 additions & 6 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:
4646
python-version: 3.13
47-
- name: Package
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

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![Coverage Status][codecov-image]][codecov-link]
44
[![PyPI Version][pypi-image]][pypi-link]
55
[![PyPI - Python Version][python-image]][pypi-link]
6-
![License][license-image-mit]
6+
[![License][license-image-mit]][license-link]
77
# PySpelling
88

99
## Overview

0 commit comments

Comments
 (0)