-
-
Notifications
You must be signed in to change notification settings - Fork 97
59 lines (55 loc) · 1.48 KB
/
publish-pypi.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: Build and publish Python distributions to PyPI
on:
push:
branches: ["master"]
tags: ["*"]
pull_request:
branches: ["*"]
env:
UV_VERSION: 0.5.31
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
- "3.13"
steps:
- uses: actions/checkout@master
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VERSION }}
python-verson: ${{ matrix.python-version }}
- name: Pytest
run: uv run pytest
- name: Ruff check
run: uv run ruff check
- name: Ruff format
run: uv run ruff format --check --diff
- name: Mypy type check
run: uv run mypy .
- name: Check if README.md automatically generated content is up to date
run: diff -u -Z README.md <(uvx [email protected] README.md)
build-n-publish:
name: Build and publish Python distributions to PyPI
runs-on: ubuntu-latest
needs: checks
steps:
- uses: actions/checkout@master
- name: Install uv
uses: astral-sh/setup-uv@v5
with:
version: ${{ env.UV_VERSION }}
- name: Build wheel
run: uv build
- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.pypi_token }}