From dec199167077e7d5f5f2aab79ca3247aa75dc76d 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 900ddccfe8a4e..38b4abc0ad3cf 100644 --- a/Makefile +++ b/Makefile @@ -707,13 +707,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) @@ -1643,14 +1636,15 @@ rustup-install-target-toolchain: rustup-set-version # 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 7947e7d1b6a4773a687a9a9bdba46d614508d44e 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 38b4abc0ad3cf..a3c66f039b99f 100644 --- a/Makefile +++ b/Makefile @@ -1637,8 +1637,8 @@ rustup-install-target-toolchain: rustup-set-version # 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