Skip to content

Commit d0447aa

Browse files
author
Guillaume Latour
committed
feat: trusted publisher management
1 parent ebf6aee commit d0447aa

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

.github/workflows/python-publish.yml

+20-19
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,25 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
deploy:
20-
19+
pypi-publish:
20+
name: Upload release to PyPI
2121
runs-on: ubuntu-latest
22-
22+
environment:
23+
name: pypi
24+
url: https://pypi.org/p/tomtom-api
25+
permissions:
26+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
2327
steps:
24-
- uses: actions/checkout@v3
25-
- name: Set up Python
26-
uses: actions/setup-python@v3
27-
with:
28-
python-version: '3.x'
29-
- name: Install dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
pip install build
33-
- name: Build package
34-
run: python -m build
35-
- name: Publish package
36-
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
37-
with:
38-
user: __token__
39-
password: ${{ secrets.PYPI_API_TOKEN }}
28+
- uses: actions/checkout@v3
29+
- name: Set up Python
30+
uses: actions/setup-python@v3
31+
with:
32+
python-version: "3.x"
33+
- name: Install dependencies
34+
run: |
35+
python -m pip install --upgrade pip
36+
pip install build
37+
- name: Build package
38+
run: python -m build
39+
- name: Publish package distributions to PyPI
40+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)