Skip to content

Commit

Permalink
[v14] release: Always use latest changelog tool (#47313)
Browse files Browse the repository at this point in the history
* release: Always use latest changelog tool

Use `@latest` when running the changelog tool so we do not have to keep
bumping the version (and backporting that version bump to the release
branches) when we update the tool.

Invoke the tool directly with `go run` instead of first installing it
with `go install` mostly because it's simpler, but also because the
installed tool never gets cleaned up (and due to a missing `.PHONY`, it
would stick to an old version).

Always run the changelog tool silently (using `@` with make) so we can
easily redirect the output of the tool to a file without needing to
clean the `make` output. One can easily run `make -n changelog` to see
the command being invoked if necessary.

* fixup! release: Always use latest changelog tool
  • Loading branch information
camscale authored Oct 9, 2024
1 parent e5e2e59 commit 6c27b85
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -705,13 +705,6 @@ $(RERUN): $(wildcard $(TOOLINGDIR)/cmd/rerun/*.go)
RELEASE_NOTES_GEN := $(TOOLINGDIR)/bin/release-notes
$(RELEASE_NOTES_GEN): $(wildcard $(TOOLINGDIR)/cmd/release-notes/*.go)
cd $(TOOLINGDIR) && go build -o "$@" ./cmd/release-notes
#
# Downloads and builds changelog from source.
# PHONY is set so that we rely on Go's mod cache and not Make's cache.
#
CHANGELOG := $(TOOLINGDIR)/bin/changelog
$(CHANGELOG):
GOBIN=$(TOOLINGDIR)/bin go install github.com/gravitational/shared-workflows/tools/[email protected]

.PHONY: tooling
tooling: ensure-gotestsum $(DIFF_TEST)
Expand Down Expand Up @@ -1593,14 +1586,15 @@ rustup-install-target-toolchain:
# changelog generates PR changelog between the provided base tag and the tip of
# the specified branch.
#
# usage: make -s changelog
# usage: make -s changelog BASE_BRANCH=branch/v13 BASE_TAG=13.2.0
# usage: BASE_BRANCH=branch/v13 BASE_TAG=13.2.0 make -s changelog
# usage: make changelog
# usage: make changelog BASE_BRANCH=branch/v13 BASE_TAG=v13.2.0
# usage: BASE_BRANCH=branch/v13 BASE_TAG=v13.2.0 make changelog
#
# BASE_BRANCH and BASE_TAG will be automatically determined if not specified.
CHANGELOG = github.com/gravitational/shared-workflows/tools/changelog@latest
.PHONY: changelog
changelog: $(CHANGELOG)
$(CHANGELOG) --base-branch="$(BASE_BRANCH)" --base-tag="$(BASE_TAG)" ./
changelog:
@go run $(CHANGELOG) --base-branch="$(BASE_BRANCH)" --base-tag="$(BASE_TAG)" ./

# create-github-release will generate release notes from the CHANGELOG.md and will
# create release notes from them.
Expand Down

0 comments on commit 6c27b85

Please sign in to comment.