Skip to content

Commit a136ad4

Browse files
committed
Switch to tag-triggered trusted publishing
1 parent 0234b3f commit a136ad4

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

.github/workflows/publish.yml

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,23 @@
1-
name: Upload Python Package
1+
name: Publish
22
on:
3-
release:
4-
types: [created]
3+
push:
4+
tags:
5+
- 'v[0-9]+.[0-9]+.[0-9]+'
56
jobs:
6-
deploy:
7+
publish:
78
runs-on: ubuntu-latest
9+
environment:
10+
name: pypi
11+
url: https://pypi.org/p/${{ github.event.repository.name }}
12+
permissions:
13+
id-token: write
814
steps:
9-
- uses: actions/checkout@v4
10-
- name: Set up Python
11-
uses: actions/setup-python@v5
12-
with:
13-
python-version: "3.13"
14-
- name: Install dependencies
15-
run: |
16-
python -m pip install --upgrade pip
17-
pip install setuptools wheel twine
18-
- name: Build and publish
19-
env:
20-
TWINE_USERNAME: __token__
21-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
22-
run: |
23-
python setup.py sdist bdist_wheel
24-
twine upload dist/*
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.13
19+
- run: |
20+
python -m pip install --upgrade build
21+
python -m build
22+
- name: Publish to PyPI
23+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)