@@ -47,15 +47,19 @@ build: ## Build all images
4747clean : stop # # Stop and remove volumes
4848 @$(COMPOSE ) down -v
4949
50- release : # # Bump patch version, tag, and push (triggers PyPI publish)
50+ release : # # Tag a patch release and push (triggers PyPI publish)
5151 @$(MAKE ) _release BUMP=patch
5252
53- release-minor : # # Bump minor version, tag, and push
53+ release-minor : # # Tag a minor release and push
5454 @$(MAKE ) _release BUMP=minor
5555
56- release-major : # # Bump major version, tag, and push
56+ release-major : # # Tag a major release and push
5757 @$(MAKE ) _release BUMP=major
5858
59+ # Version lives in git tags. We read the latest v* tag, bump the requested
60+ # component, push the new tag — and that's it. No source edits, no
61+ # "Release vX.Y.Z" commits. The publish.yml workflow runs on tag push and
62+ # setuptools-scm reads the version straight from the tag at build time.
5963_release :
6064 @if [ -n " $$ (git status --porcelain)" ]; then \
6165 echo " Working tree is dirty. Commit or stash first." ; exit 1; \
@@ -64,15 +68,13 @@ _release:
6468 echo " Release must be run from main (currently on $$ (git rev-parse --abbrev-ref HEAD))." ; exit 1; \
6569 fi
6670 @git pull --ff-only origin main
67- @OLD=$$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb' ) )[' project' ][' version' ])" ) && \
71+ @git fetch --tags origin
72+ @OLD=$$(git tag -l 'v*' | sed 's/^v//' | sort -V | tail -n1 ) && \
73+ if [ -z " $$ OLD" ]; then OLD=" 0.0.0" ; fi && \
6874 NEW=$$(python3 -c "v='$$OLD'.split('.' ) ; part=' $(BUMP)' ; \
6975 idx={' major' :0,' minor' :1,' patch' :2}[part]; v[idx]=str(int(v[idx])+1); \
7076 [v.__setitem__(i,' 0' ) for i in range(idx+1,3)]; print(' .' .join(v))" ) && \
71- echo " Bumping $$ OLD -> $$ NEW" && \
72- python3 -c " import re,pathlib; p=pathlib.Path('pyproject.toml'); p.write_text(re.sub(r'^version = \" .*\" ', 'version = \" '+'$$ NEW'+'\" ', p.read_text(), count=1, flags=re.M))" && \
73- git add pyproject.toml && \
74- git commit -m " Release v$$ NEW" && \
77+ echo " Releasing v$$ NEW (previous: v$$ OLD)" && \
7578 git tag " v$$ NEW" && \
76- git push origin main && \
7779 git push origin " v$$ NEW" && \
7880 echo " Pushed v$$ NEW. Watch https://github.com/awslabs/llm-evaluation-system/actions"
0 commit comments