Skip to content

Commit 2aa3136

Browse files
feat: add release management with hatch-vcs (#50)
* feat: add release management with hatch-vcs and GitHub Actions Derive version from git tags via hatch-vcs instead of hardcoding in pyproject.toml and coral/__init__.py. Add GitHub Actions workflow that builds, publishes to PyPI, and creates a GitHub Release with auto-generated release notes on v* tag push. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: remove PyPI publish from release workflow Keep it simple — only build and create GitHub Release with artifacts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5c20c88 commit 2aa3136

6 files changed

Lines changed: 1454 additions & 1371 deletions

File tree

.github/release.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
changelog:
2+
categories:
3+
- title: Features
4+
labels:
5+
- enhancement
6+
- feature
7+
- title: Bug Fixes
8+
labels:
9+
- bug
10+
- fix
11+
- title: Other Changes
12+
labels:
13+
- "*"

.github/workflows/release.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Build & Release
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
24+
- name: Install hatch
25+
run: pip install hatch
26+
27+
- name: Build package
28+
run: hatch build
29+
30+
- uses: softprops/action-gh-release@v2
31+
with:
32+
generate_release_notes: true
33+
files: dist/*

coral/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""CORAL - Orchestration system for autonomous coding agents."""
22

3-
__version__ = "0.2.0"
3+
from importlib.metadata import version
4+
5+
__version__ = version("coral")
46

57
from coral.types import Attempt, Score, ScoreBundle, Task
68
from coral.config import CoralConfig

coral/_version.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# file generated by vcs-versioning
2+
# don't change, don't track in version control
3+
from __future__ import annotations
4+
5+
__all__ = [
6+
"__version__",
7+
"__version_tuple__",
8+
"version",
9+
"version_tuple",
10+
"__commit_id__",
11+
"commit_id",
12+
]
13+
14+
version: str
15+
__version__: str
16+
__version_tuple__: tuple[int | str, ...]
17+
version_tuple: tuple[int | str, ...]
18+
commit_id: str | None
19+
__commit_id__: str | None
20+
21+
__version__ = version = '0.1.dev69+g5c20c8819.d20260410'
22+
__version_tuple__ = version_tuple = (0, 1, 'dev69', 'g5c20c8819.d20260410')
23+
24+
__commit_id__ = commit_id = None

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["hatchling"]
2+
requires = ["hatchling", "hatch-vcs"]
33
build-backend = "hatchling.build"
44

55
[project]
66
name = "coral"
7-
version = "0.2.0"
7+
dynamic = ["version"]
88
description = "Orchestration system for autonomous coding agents"
99
readme = "README.md"
1010
license = "MIT"
@@ -61,6 +61,12 @@ coral = "coral.cli:main"
6161
Homepage = "https://github.com/Human-Agent-Society/CORAL"
6262
Repository = "https://github.com/Human-Agent-Society/CORAL"
6363

64+
[tool.hatch.version]
65+
source = "vcs"
66+
67+
[tool.hatch.build.hooks.vcs]
68+
version-file = "coral/_version.py"
69+
6470
[tool.hatch.build.targets.wheel]
6571
packages = ["coral"]
6672

0 commit comments

Comments
 (0)