Skip to content

Commit 0f6b91a

Browse files
committed
Update publish workflow to use trusted publisher (pypa/gh-action-pypi-publish)
1 parent c2871cf commit 0f6b91a

1 file changed

Lines changed: 12 additions & 21 deletions

File tree

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3-
41
name: Upload Python Package
52

63
on:
@@ -9,23 +6,17 @@ on:
96

107
jobs:
118
deploy:
12-
139
runs-on: ubuntu-latest
14-
10+
permissions:
11+
id-token: write
1512
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.12'
17+
- name: Install build tools
18+
run: pip install build
19+
- name: Build package
20+
run: python -m build
21+
- name: Publish to PyPI
22+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)