Skip to content

Commit e541ab5

Browse files
committed
Use trusted publishing for the release on PyPI
1 parent 06a2a85 commit e541ab5

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

.github/workflows/publish_on_pypi.yml

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,30 @@ jobs:
99
publish:
1010
runs-on: ubuntu-latest
1111

12+
# authenticate with an OpenID Connect token issued by GitHub
13+
# instead of an API token, using the trusted publisher on PyPI
14+
# that has been registered for this workflow and environment
15+
permissions:
16+
id-token: write
17+
18+
environment:
19+
name: pypi
20+
url: https://pypi.org/p/DBUtils
21+
1222
steps:
13-
- uses: actions/checkout@v5
23+
- name: Check out the repository
24+
uses: actions/checkout@v7
1425

15-
- name: Set up Python
16-
uses: actions/setup-python@v6
17-
with:
18-
python-version: "3.14"
26+
- name: Set up Python
27+
uses: actions/setup-python@v7
28+
with:
29+
python-version: "3.14"
1930

20-
- name: Install build tool
21-
run: python -m pip install build --user
31+
- name: Install build tool
32+
run: python -m pip install build --user
2233

23-
- name: Build source tarball and wheel
24-
run: python -m build
34+
- name: Build source tarball and wheel
35+
run: python -m build
2536

26-
- name: Publish distribution to PyPI
27-
uses: pypa/gh-action-pypi-publish@release/v1
28-
with:
29-
user: __token__
30-
password: ${{ secrets.PYPI_TOKEN }}
37+
- name: Publish distribution to PyPI
38+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/test_with_tox.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
python: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
1111

1212
steps:
13-
- uses: actions/checkout@v5
13+
- uses: actions/checkout@v7
1414

1515
- name: Setup Python ${{ matrix.python }}
16-
uses: actions/setup-python@v6
16+
uses: actions/setup-python@v7
1717
with:
1818
python-version: ${{ matrix.python }}
1919

0 commit comments

Comments
 (0)