Skip to content

Commit

Permalink
Add updte changelog target
Browse files Browse the repository at this point in the history
  • Loading branch information
maurolacy committed Feb 14, 2024
1 parent 00ed40b commit 19a929f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
16 changes: 16 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,14 @@ endif
BUILD_TARGETS := build install
BUILD_FLAGS := --tags "$(build_tags)" --ldflags '$(ldflags)'

# Update changelog vars
ifneq (,$(SINCE_TAG))
sinceTag := --since-tag $(SINCE_TAG)
endif
ifneq (,$(UPCOMING_TAG))
upcomingTag := --future-release $(UPCOMING_TAG)
endif

all: build install

build: BUILD_ARGS := $(build_args) -o $(BUILDDIR)
Expand All @@ -55,3 +63,11 @@ test-e2e:
mock-gen:
mkdir -p $(MOCKS_DIR)
$(MOCKGEN_CMD) -source=clientcontroller/interface.go -package mocks -destination $(MOCKS_DIR)/babylon.go

.PHONY: mock-gen

update-changelog:
@echo ./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)
./scripts/update_changelog.sh $(sinceTag) $(upcomingTag)

.PHONY: update-changelog
10 changes: 5 additions & 5 deletions scripts/update_changelog.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ OPTS=$(getopt -l "help,release-branch:,since-tag:,future-release:,full,token:" -
function print_usage() {
echo -e "Usage: $0 [-h|--help] [-f|--full] [--release-branch <branch>] [--since-tag <tag>] [--future-release] <tag> [-t|--token <token>]
-h, --help Display help
-f, --full Process changes since the beginning (by default: since latest git version tag)
--since-tag <tag> Process changes since git version tag <tag> (by default: since latest git version tag)
--future-release <tag> Put the unreleased changes in the specified <tag>
-h, --help Display help.
-f, --full Process changes since the beginning (by default: since latest git version tag).
--since-tag <tag> Process changes since git version tag <tag> (by default: since latest git version tag).
--future-release <tag> Put the unreleased changes in the specified <tag>.
--release-branch <branch> Limit pull requests to the release branch <branch>.
--token <token> Pass changelog github token <token>"
--token <token> Pass changelog github token <token>."
}

function remove_opt() {
Expand Down

0 comments on commit 19a929f

Please sign in to comment.