Skip to content

Commit 7b2b1da

Browse files
committed
automate versioning in release workflow
1 parent 56ef795 commit 7b2b1da

3 files changed

Lines changed: 488 additions & 12 deletions

File tree

.github/workflows/release.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@ jobs:
88
deploy:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
12-
- name: Set up Python
13-
uses: actions/setup-python@v2
11+
- uses: actions/checkout@v4
1412
with:
15-
python-version: "3.x"
16-
- name: Install build backend
17-
run: python -m pip install --upgrade pip build twine
13+
fetch-depth: 0 # Need full history for version from git tags
14+
- name: Install uv
15+
run: curl -LsSf https://astral.sh/uv/install.sh | sh
16+
- name: Add uv to PATH
17+
run: echo "$HOME/.cargo/bin" >> $GITHUB_PATH
18+
- name: Install dependencies
19+
run: uv sync --extra dev
1820
- name: Build and publish
1921
env:
2022
TWINE_USERNAME: __token__
2123
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
2224
run: |
23-
python -m build
24-
twine upload --repository pypi dist/*
25+
uv build
26+
uv run twine upload --repository pypi dist/*

pyproject.toml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "python-smarttub"
3-
version = "0.0.39"
3+
dynamic = ["version"]
44
description = "API to query and control hot tubs using the SmartTub system"
55
readme = "README.md"
66
requires-python = ">=3.9"
@@ -19,13 +19,17 @@ dev = [
1919
"aresponses",
2020
"pre-commit",
2121
"black",
22-
"flake8"
22+
"flake8",
23+
"twine"
2324
]
2425

2526
[build-system]
26-
requires = ["hatchling"]
27+
requires = ["hatchling", "hatch-vcs"]
2728
build-backend = "hatchling.build"
2829

30+
[tool.hatch.version]
31+
source = "vcs"
32+
2933
[tool.pytest.ini_options]
3034
testpaths = ["tests"]
3135
python_files = ["test_*.py"]

0 commit comments

Comments
 (0)