-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (34 loc) · 959 Bytes
/
publish.yml
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
43
44
name: Publish to PyPI
on:
release:
types: [published]
jobs:
publish:
name: Build and Publish to PyPI
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
enable-cache: true
cache-dependency-glob: "uv.lock"
- name: Set up Python
run: uv python install
- name: Extract version from release
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Update version in pyproject.toml
run: |
sed -i "s/version = \".*\"/version = \"$VERSION\"/" pyproject.toml
- name: Install build dependencies
run: uv sync --all-extras
- name: Build the project
run: uv build
- name: Publish to PyPI
run: uv publish