Skip to content

Commit

Permalink
Add make command for print GitHub release note generator prompt with …
Browse files Browse the repository at this point in the history
…commits changes
  • Loading branch information
mhdzumair committed Jun 29, 2024
1 parent 524d6a7 commit c5cfaec
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ DOCKER_IMAGE = $(DOCKER_REPO)/$(IMAGE_NAME):$(VERSION)
HTTP_PROXY = http://172.17.0.1:1081
HTTPS_PROXY = http://172.17.0.1:1081

# Variables to hold version tags and contributor names
VERSION_OLD ?=
VERSION_NEW ?=
CONTRIBUTORS ?=

.PHONY: build tag push
.PHONY: build tag push prompt

build:
docker build --build-arg GIT_REV=$(GIT_REV) -t $(DOCKER_IMAGE) -f deployment/Dockerfile .
Expand All @@ -47,4 +51,26 @@ build-multi:
push:
docker push $(DOCKER_IMAGE)

prompt:
# Check if necessary variables are set and generate prompt
ifndef VERSION_OLD
@echo "Error: VERSION_OLD is not set. Please set it like: make prompt VERSION_OLD=x.x.x VERSION_NEW=y.y.y CONTRIBUTORS='@user1, @user2'"
@exit 1
endif
ifndef VERSION_NEW
@echo "Error: VERSION_NEW is not set. Please set it like: make prompt VERSION_OLD=x.x.x VERSION_NEW=y.y.y CONTRIBUTORS='@user1, @user2'"
@exit 1
endif
ifndef CONTRIBUTORS
@echo "Warning: CONTRIBUTORS not set. Continuing without contributors."
endif

@echo "Generate a release note for MediaFusion $(VERSION_NEW) by analyzing the following changes. Organize the release note by importance rather than by commit order. highlight the most significant updates first, and streamline the content to focus on what adds the most value to the user. Ensure to dynamically create sections for New Features & Enhancements, Bug Fixes, and Documentation updates only if relevant based on the types of changes listed. Use emojis relevantly at the start of each item to enhance readability and engagement. Keep the format straightforward & shorter, List down the contributors, and provide a direct link to the detailed list of changes:\n"
@echo "## 🚀 MediaFusion $(VERSION_NEW) Released\n"
@echo "### Commit Messages:\n"
@echo "$$(git log --pretty=format:'- %s' $(VERSION_OLD)..$(VERSION_NEW))\n"
@echo "### 🤝 Contributors: $(CONTRIBUTORS)\n"
@echo "### 📄 Full Changelog:\n- https://github.com/mhdzumair/MediaFusion/compare/$(VERSION_OLD)...$(VERSION_NEW)"


all: build-multi

0 comments on commit c5cfaec

Please sign in to comment.