Skip to content

Commit 91d4d5b

Browse files
authored
Create python-package.yml
1 parent 733168f commit 91d4d5b

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Python Package
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
workflow_dispatch:
8+
9+
jobs:
10+
build-and-publish:
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
contents: read
15+
packages: write
16+
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up uv
22+
uses: astral-sh/setup-uv@v3
23+
with:
24+
python-version: "3.12"
25+
26+
- name: Install dependencies
27+
run: |
28+
uv python install 3.12
29+
uv sync --all-extras
30+
31+
- name: Run tests
32+
run: make test
33+
34+
- name: Build package
35+
run: make build
36+
37+
- name: Publish to PyPI
38+
if: startsWith(github.ref, 'refs/tags/')
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
with:
41+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)