Skip to content

Commit e17fedd

Browse files
committed
Use trusted publishing
1 parent cddf64c commit e17fedd

File tree

1 file changed

+14
-24
lines changed

1 file changed

+14
-24
lines changed

.github/workflows/publish.yml

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,23 @@
11
name: Publish
22
on:
3-
release:
4-
types: [published]
5-
3+
push:
4+
tags:
5+
- '[0-9]+.[0-9]+.[0-9]+'
66
jobs:
77
publish:
88
runs-on: ubuntu-latest
9-
9+
environment:
10+
name: pypi
11+
url: https://pypi.org/p/${{ github.event.repository.name }}
12+
permissions:
13+
id-token: write
1014
steps:
11-
- uses: actions/checkout@v2
12-
13-
- name: Set up Python 3
14-
uses: actions/setup-python@v2
15+
- uses: actions/checkout@v4
16+
- uses: actions/setup-python@v5
1517
with:
16-
python-version: 3
17-
18-
- name: Build distribution
19-
run: |
20-
pip install -U setuptools wheel
21-
python setup.py sdist bdist_wheel
22-
23-
- name: Publish to TestPyPI
24-
uses: pypa/gh-action-pypi-publish@release/v1
25-
with:
26-
password: ${{ secrets.TEST_PYPI_TOKEN }}
27-
repository_url: https://test.pypi.org/legacy/
28-
skip_existing: true
29-
18+
python-version: 3.13
19+
- run: |
20+
python -m pip install --upgrade build
21+
python -m build
3022
- name: Publish to PyPI
3123
uses: pypa/gh-action-pypi-publish@release/v1
32-
with:
33-
password: ${{ secrets.PYPI_TOKEN }}

0 commit comments

Comments
 (0)