-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (36 loc) · 895 Bytes
/
publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Build package / publish
on:
pull_request:
branches: [ main ]
push:
branches: [ main ]
tags: [ "v*" ]
release:
types: [ published ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
python-version: "3.13"
# Uncomment for testing
# UV_PUBLISH_URL: https://test.pypi.org/legacy/
jobs:
publish:
environment:
name: publish
permissions:
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "**/pyproject.toml"
python-version: ${{ env.python-version }}
- run: uv build
- run: uv publish --trusted-publishing=always
if: >-
github.event_name == 'release' || (
github.event_name == 'push'
&& startsWith(github.ref, 'refs/tags')
)