From d754dace4b1171e9e2883266b9b5bcfc55c12ebc Mon Sep 17 00:00:00 2001 From: Cam Hutchison Date: Mon, 7 Oct 2024 17:59:58 +1100 Subject: [PATCH 1/2] 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. --- Makefile | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index f98fb5c65e48..80312b82f4af 100644 --- a/Makefile +++ b/Makefile @@ -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/changelog@v1.0.0 .PHONY: tooling tooling: ensure-gotestsum $(DIFF_TEST) @@ -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=13.2.0 +# usage: BASE_BRANCH=branch/v13 BASE_TAG=13.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. From fb0408e81d22e420edc8526c0c176422d75581eb Mon Sep 17 00:00:00 2001 From: Cam Hutchison Date: Tue, 8 Oct 2024 10:16:32 +1100 Subject: [PATCH 2/2] fixup! release: Always use latest changelog tool --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 80312b82f4af..bbfe72a34980 100644 --- a/Makefile +++ b/Makefile @@ -1587,8 +1587,8 @@ rustup-install-target-toolchain: # the specified branch. # # usage: make changelog -# usage: make changelog BASE_BRANCH=branch/v13 BASE_TAG=13.2.0 -# usage: BASE_BRANCH=branch/v13 BASE_TAG=13.2.0 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