Skip to content

Commit

Permalink
[v15] build: Fix "make create-github-release" (#49168)
Browse files Browse the repository at this point in the history
* build: Fix "make create-github-release"

Fix the `create-github-release` make target to use "go run" to run the
tool that creates the github release. This used to run a tool in this
repository that was pre-built, so the "go run" was not needed before.
Now the tool has moved to a separate repository, this is required.

* build: Remove single-use vars for simplicity

Remove the `CHANGELOG` and `RELEASE_NOTES_GEN` vars that contained the
name of a Go main package to run in favor of a straightforward "go run"
command.
  • Loading branch information
camscale authored Nov 19, 2024
1 parent 7a9dfbd commit ca0d551
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1638,10 +1638,10 @@ rustup-install-target-toolchain: rustup-set-version
# 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:
@go run $(CHANGELOG) --base-branch="$(BASE_BRANCH)" --base-tag="$(BASE_TAG)" ./
@go run github.com/gravitational/shared-workflows/tools/changelog@latest \
--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 All @@ -1655,12 +1655,14 @@ changelog:
#
# For more information on release notes generation see:
# https://github.com/gravitational/shared-workflows/tree/gus/release-notes/tools/release-notes#readme
RELEASE_NOTES_GEN = github.com/gravitational/shared-workflows/tools/release-notes@latest
.PHONY: create-github-release
create-github-release: LATEST = false
create-github-release: GITHUB_RELEASE_LABELS = ""
create-github-release:
@NOTES=$$($(RELEASE_NOTES_GEN) --labels=$(GITHUB_RELEASE_LABELS) $(VERSION) CHANGELOG.md) && gh release create v$(VERSION) \
@NOTES=$$( \
go run github.com/gravitational/shared-workflows/tools/release-notes@latest \
--labels=$(GITHUB_RELEASE_LABELS) $(VERSION) CHANGELOG.md \
) && gh release create v$(VERSION) \
-t "Teleport $(VERSION)" \
--latest=$(LATEST) \
--verify-tag \
Expand Down

0 comments on commit ca0d551

Please sign in to comment.