Created make formulae for semver tagging
This commit is contained in:
parent
9a367bb78b
commit
ab8f86c73d
1 changed files with 18 additions and 1 deletions
19
Makefile
19
Makefile
|
|
@ -1,4 +1,9 @@
|
|||
.PHONY: build frontend-build dev clean test
|
||||
.PHONY: build frontend-build dev clean test patch minor major
|
||||
|
||||
LAST_TAG := $(shell git tag --sort=-v:refname | head -1)
|
||||
MAJOR := $(shell echo $(LAST_TAG) | sed 's/^v//' | cut -d. -f1)
|
||||
MINOR := $(shell echo $(LAST_TAG) | sed 's/^v//' | cut -d. -f2)
|
||||
PATCH := $(shell echo $(LAST_TAG) | sed 's/^v//' | cut -d. -f3)
|
||||
|
||||
build: frontend-build
|
||||
CGO_ENABLED=0 go build -ldflags "-X main.buildID=$$(git rev-parse --short HEAD)" -o turnpike .
|
||||
|
|
@ -18,3 +23,15 @@ test:
|
|||
clean:
|
||||
rm -f turnpike dev.db
|
||||
rm -rf frontend/dist
|
||||
|
||||
patch:
|
||||
git tag v$(MAJOR).$(MINOR).$(shell echo $$(($(PATCH)+1)))
|
||||
@echo "Tagged v$(MAJOR).$(MINOR).$(shell echo $$(($(PATCH)+1)))"
|
||||
|
||||
minor:
|
||||
git tag v$(MAJOR).$(shell echo $$(($(MINOR)+1))).0
|
||||
@echo "Tagged v$(MAJOR).$(shell echo $$(($(MINOR)+1))).0"
|
||||
|
||||
major:
|
||||
git tag v$(shell echo $$(($(MAJOR)+1))).0.0
|
||||
@echo "Tagged v$(shell echo $$(($(MAJOR)+1))).0.0"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue