@@ -114,16 +114,28 @@ logs:
114114connect :
115115 ssh -p 2222 cloud-claude
116116
117- # Create a new release (usage: make tag VERSION=v0.1.0)
118- tag :
119- ifndef VERSION
120- $(error VERSION is required. Usage: make tag VERSION=v0.1.0)
121- endif
122- @echo "Creating release $(VERSION)..."
123- git tag -a $(VERSION) -m "Release $(VERSION)"
124- git push origin $(VERSION)
125- @echo "Done! GitHub Actions will build and publish the release."
126- @echo "View at: https://github.com/bborn/taskyou/releases/tag/$(VERSION)"
117+ # Cut a new patch release (auto-increments from latest tag)
118+ # Usage: make release → v0.2.21 becomes v0.2.22
119+ # make release BUMP=minor → v0.2.21 becomes v0.3.0
120+ # make release BUMP=major → v0.2.21 becomes v1.0.0
121+ BUMP ?= patch
122+ release :
123+ @LATEST=$$(git tag -l 'v*' --sort=-v:refname | head -1 ) ; \
124+ if [ -z " $$ LATEST" ]; then LATEST=" v0.0.0" ; fi ; \
125+ MAJOR=$$(echo $$LATEST | sed 's/^v//' | cut -d. -f1 ) ; \
126+ MINOR=$$(echo $$LATEST | sed 's/^v//' | cut -d. -f2 ) ; \
127+ PATCH=$$(echo $$LATEST | sed 's/^v//' | cut -d. -f3 ) ; \
128+ case " $( BUMP) " in \
129+ major) MAJOR=$$((MAJOR+1 ) ); MINOR=0; PATCH=0;; \
130+ minor) MINOR=$$((MINOR+1 ) ); PATCH=0;; \
131+ patch) PATCH=$$((PATCH+1 ) );; \
132+ * ) echo " Invalid BUMP=$( BUMP) . Use patch, minor, or major." ; exit 1;; \
133+ esac ; \
134+ NEXT=" v$$ MAJOR.$$ MINOR.$$ PATCH" ; \
135+ echo " $$ LATEST → $$ NEXT" ; \
136+ git tag -a $$ NEXT -m " Release $$ NEXT" && \
137+ git push origin $$ NEXT && \
138+ echo " Done! View at: https://github.com/bborn/taskyou/releases/tag/$$ NEXT"
127139
128140# Format code
129141fmt :
0 commit comments