Skip to content

Commit 4858684

Browse files
committed
Add trusted publishing from a tag
Signed-off-by: Martin Prpič <martin.prpic@gmail.com>
1 parent 58b874f commit 4858684

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- '[0-9]+.[0-9]+.[0-9]+'
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build-and-publish:
13+
name: Build and publish to PyPI
14+
if: ${{ github.repository_owner == 'mprpic' }}
15+
16+
runs-on: ubuntu-latest
17+
environment: release
18+
19+
permissions:
20+
contents: read
21+
id-token: write
22+
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Install uv
26+
uses: astral-sh/setup-uv@v6
27+
- name: Build sdist and wheel
28+
run: uv build
29+
- name: Publish to PyPI
30+
if: startsWith(github.ref, 'refs/tags')
31+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)