Skip to content

Commit b26b577

Browse files
committed
ci: move workflows to uv
1 parent dbb0eb9 commit b26b577

File tree

2 files changed

+41
-25
lines changed

2 files changed

+41
-25
lines changed

.github/workflows/release.yml

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,26 @@ jobs:
99
deploy:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
13-
- name: Install poetry
14-
run: pipx install poetry
12+
- uses: actions/checkout@v4
13+
1514
- name: Set up Python
16-
uses: actions/setup-python@v4
15+
uses: actions/setup-python@v5
1716
with:
18-
python-version: "3.9"
19-
- name: Install deps
20-
run: poetry install
21-
- name: Set version
22-
run: poetry version "${{ github.ref_name }}"
23-
- name: Release package
17+
python-version: "3.12"
18+
19+
- name: Install uv
20+
uses: astral-sh/setup-uv@v1
21+
22+
- name: Install project
23+
run: uv pip install .
24+
25+
- name: Set version from tag
26+
run: uvx hatch version "${{ github.ref_name }}"
27+
28+
- name: Build artifacts
29+
run: uv build
30+
31+
- name: Publish package
2432
env:
25-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
26-
run: poetry publish --build
33+
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_TOKEN }}
34+
run: uv publish --token "${{ secrets.PYPI_TOKEN }}"

.github/workflows/test.yml

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,29 @@ jobs:
88
lint:
99
strategy:
1010
matrix:
11-
cmd:
12-
- black
13-
- mypy
14-
- ruff
11+
python-version: ["3.10", "3.11", "3.12", "3.13"]
12+
cmd: ["black", "mypy", "ruff"]
1513
runs-on: ubuntu-latest
1614
steps:
17-
- uses: actions/checkout@v2
18-
- name: Install poetry
19-
run: pipx install poetry
15+
- uses: actions/checkout@v4
16+
2017
- name: Set up Python
21-
uses: actions/setup-python@v4
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install uv
23+
uses: astral-sh/setup-uv@v1
24+
25+
- name: Cache uv dependencies
26+
uses: actions/cache@v4
2227
with:
23-
python-version: "3.9"
24-
cache: "poetry"
25-
- name: Install deps
26-
run: poetry install
28+
path: ~/.cache/uv
29+
key: >-
30+
${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
31+
32+
- name: Install dependencies
33+
run: uv pip install ".[dev]"
34+
2735
- name: Run lint check
28-
run: poetry run pre-commit run -a ${{ matrix.cmd }}
36+
run: uv run pre-commit run -a ${{ matrix.cmd }}

0 commit comments

Comments
 (0)