Skip to content

Commit

Permalink
Fix pipelines #minor
Browse files Browse the repository at this point in the history
Signed-off-by: Mustafa Kara <[email protected]>
  • Loading branch information
mustafaahmetkara committed Feb 27, 2024
1 parent 680b339 commit e08fa85
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
fetch-tags: true
fetch-depth: 0

- name: 'Generate Tag'
- name: 'Generate Release'
env:
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
make tag
make release
28 changes: 0 additions & 28 deletions .github/workflows/release-on-push-tag.yaml

This file was deleted.

29 changes: 26 additions & 3 deletions .mk/release_release.mk
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
25 changes: 0 additions & 25 deletions .mk/release_tag.mk

This file was deleted.

0 comments on commit e08fa85

Please sign in to comment.