-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mustafa Kara <[email protected]>
- Loading branch information
1 parent
680b339
commit e08fa85
Showing
4 changed files
with
28 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
.PHONY: release/release | ||
release/release: | ||
@gh release create $(TAG) --generate-notes | ||
COMMIT_TYPE :=$(subst #,,$(shell git log -1 --pretty=%B | grep -E -i -o "#(minor|major|patch)")) | ||
CURRENT_TAG :=$(or $(shell git tag | sort -r --version-sort | head -n1 ), v0.0.0) | ||
VERSION = $(subst v,,$(CURRENT_TAG)) | ||
VERSION_PARTS = $(subst ., ,$(VERSION)) | ||
MAJOR = $(word 1,$(VERSION_PARTS)) | ||
MINOR = $(word 2,$(VERSION_PARTS)) | ||
PATCH = $(word 3,$(VERSION_PARTS)) | ||
|
||
ifeq ($(COMMIT_TYPE),major) | ||
NEXT_VERSION= v$(shell echo $$(($(MAJOR)+1))).0.0 | ||
else ifeq ($(COMMIT_TYPE),minor) | ||
NEXT_VERSION= v$(MAJOR).$(shell echo $$(($(MINOR)+1))).0 | ||
else ifeq ($(COMMIT_TYPE),patch) | ||
NEXT_VERSION= v$(MAJOR).$(MINOR).$(shell echo $$(($(PATCH)+1))) | ||
endif | ||
|
||
.PHONY: release/tag | ||
release/tag: | ||
ifneq ($(NEXT_VERSION),) | ||
@echo "Creating tag $(NEXT_VERSION)" | ||
@git tag $(NEXT_VERSION) | ||
@git push origin $(NEXT_VERSION) | ||
@gh release create $(NEXT_VERSION) --generate-notes | ||
else | ||
@echo "Last commit does not contain #major,#minor or #patch. Skipping tag!" | ||
endif |
This file was deleted.
Oops, something went wrong.