Skip to content

Commit 9b66a14

Browse files
committed
add release.yml
1 parent b74e7ff commit 9b66a14

5 files changed

Lines changed: 38 additions & 5 deletions

File tree

.github/workflows/release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [ published ]
5+
jobs:
6+
publish:
7+
name: python
8+
runs-on: ubuntu-latest
9+
environment: pypi
10+
permissions:
11+
id-token: write
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: Install uv
15+
uses: astral-sh/setup-uv@v4
16+
with:
17+
enable-cache: true
18+
cache-dependency-glob: "uv.lock"
19+
- name: Build
20+
run: |
21+
uv build
22+
- name: Publish
23+
run: |
24+
uv publish

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ __pycache__/
55
.ruff_cache/
66
.idea/
77
.DS_Store
8+
.ropeproject/

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
[project]
22
name = "sentoo"
3-
version = "0.1.0"
3+
dynamic = ["version"]
44
description = "Add your description here"
55
readme = "README.md"
66
authors = [{ name = "Lemi Boyce", email = "lemuelboyce@gmail.com" }]
77
requires-python = ">=3.12"
88
dependencies = ["httpx>=0.28.1", "pydantic>=2.11.4"]
99

10+
[tool.hatch.version]
11+
source = "uv-dynamic-versioning"
12+
13+
[tool.uv-dynamic-versioning]
14+
fallback-version = "0.0.0"
1015

1116
[tool.ruff]
1217
line-length = 100
@@ -21,7 +26,7 @@ target-version = "py312"
2126
dmypy = true
2227

2328
[build-system]
24-
requires = ["hatchling"]
29+
requires = ["hatchling", "uv-dynamic-versioning"]
2530
build-backend = "hatchling.build"
2631

2732
[dependency-groups]

src/sentoo/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1-
def hello() -> str:
2-
return "Hello from sentoo!"
1+
import importlib.metadata
2+
3+
try:
4+
__version__ = importlib.metadata.version(__name__)
5+
except importlib.metadata.PackageNotFoundError:
6+
__version__ = "0.0.0" # Fallback for development mode

uv.lock

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)