Skip to content

Commit 9de048d

Browse files
author
Inna
committed
CI workflow
1 parent 7c8fd82 commit 9de048d

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

.github/workflows/main.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
10+
release:
11+
types: [published]
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version-file: ".python-version"
26+
27+
- name: Install the project
28+
run: uv sync --frozen --all-extras --dev
29+
30+
- name: Run pyright
31+
run: uv run --frozen pyright
32+
33+
- name: Build
34+
run: uv build
35+
36+
- name: Run ruff
37+
run: uv run --frozen ruff check .
38+
39+
- name: Upload artifacts
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: release-dists
43+
path: dist/
44+
45+
pypi-publish:
46+
name: Upload release to PyPI
47+
runs-on: ubuntu-latest
48+
environment: release
49+
if: ${{ github.event_name == 'release' }}
50+
needs:
51+
- build
52+
permissions:
53+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
54+
55+
steps:
56+
- name: Retrieve release distributions
57+
uses: actions/download-artifact@v4
58+
with:
59+
name: release-dists
60+
path: dist/
61+
62+
- name: Publish package distributions to PyPI
63+
uses: pypa/gh-action-pypi-publish@release/v1

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.11

0 commit comments

Comments
 (0)