Skip to content

Commit e064d63

Browse files
committed
ci: Add py-release workflow
1 parent 30a7ebc commit e064d63

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

β€Ž.github/workflows/py-release.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: py-release.yaml
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
env:
8+
UV_VERSION: "0.7.x"
9+
PYTHON_VERSION: 3.13
10+
11+
jobs:
12+
py-release:
13+
name: Build and release Python package
14+
runs-on: ubuntu-latest
15+
16+
# Python release tags start with "py/v*"
17+
if: startsWith(github.ref, 'refs/tags/py/v')
18+
19+
environment:
20+
name: pypi
21+
url: https://pypi.org/project/shinychat/
22+
23+
permissions: # for trusted publishing
24+
id-token: write
25+
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: πŸš€ Install uv
30+
uses: astral-sh/setup-uv@v3
31+
with:
32+
version: ${{ env.UV_VERSION }}
33+
34+
- name: 🐍 Set up Python ${{ env.PYTHON_VERSION }}
35+
run: uv python install ${{ env.PYTHON_VERSION }}
36+
37+
- name: πŸ“¦ Install the project
38+
run: uv sync --python ${{ env.PYTHON_VERSION }} --all-extras
39+
40+
- name: πŸ§ͺ Check tests
41+
run: make py-check-tests
42+
43+
- name: πŸ“ Check types
44+
run: make py-check-types
45+
46+
- name: πŸ“ Check formatting
47+
run: make py-check-format
48+
49+
- name: 🧳 Build package
50+
run: uv build
51+
52+
# TODO: https://pypi.org/manage/project/shinychat/settings/publishing/
53+
- name: 🚒 Publish release on PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
Β (0)