infra: Added versioning
This commit is contained in:
25
Makefile
Normal file
25
Makefile
Normal file
@@ -0,0 +1,25 @@
|
||||
# Versioning
|
||||
check-branch-is-main:
|
||||
@current_branch=$$(git rev-parse --abbrev-ref HEAD); \
|
||||
if [ "$$current_branch" != "main" ]; then \
|
||||
echo "Error: not on the main branch" \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
BUMP = cd brain && poetry run bump-my-version bump
|
||||
|
||||
.PHONY: help patch minor major
|
||||
help:
|
||||
@echo "Versioning commands :"
|
||||
@echo " make patch : Bump version 0.0.1 (bugfix)"
|
||||
@echo " make minor : Bump version 0.1.0 (feature)"
|
||||
@echo " make major : Bump version 1.0.0 (breaking change)"
|
||||
|
||||
patch: check-branch-is-main
|
||||
SKIP=all $(BUMP) patch
|
||||
|
||||
minor: check-branch-is-main
|
||||
SKIP=all $(BUMP) minor
|
||||
|
||||
major: check-branch-is-main
|
||||
SKIP=all $(BUMP) major
|
||||
Reference in New Issue
Block a user