Files
teleport/version.mk
T
Hugo Shaka 8ea6a9b687 Consolidate all the Helm Makefiles (#65455)
* Extract Helm logic into lib

* Add helm-janitor

* Fix lint values

* Use helmjanitor for tests, lint, and version-update

* Convert example/chart Makefile to helm-janitor + add library support

* Fix release pipeline

* lint

* Disable CGO

* lint
2026-04-29 21:26:31 +00:00

40 lines
1.6 KiB
Makefile

# Include common makefile shared between OSS and Ent.
include common.mk
GITREF=$(shell git describe --long --tags)
# $(GITREF_GO) will be written to gitref.go
GITREF_GO="// Code generated by \"make version\". DO NOT EDIT.\n\n\
package teleport\n\n\
func init() { Gitref = \"$(GITREF)\" }\n"
#
# setver updates api/version.go and gitref.go with VERSION and GITREF vars
#
.PHONY: setver
setver: validate-semver helm-version tsh-version
GOWORK=off CGO_ENABLED=0 go -C build.assets/tooling run ./cmd/apiversion "$(VERSION)" > api/version.go
@printf $(GITREF_GO) | gofmt > gitref.go
# helm-version automatically updates the versions of Helm charts to match the version set in the Makefile,
# so that chart versions are also kept in sync when the Teleport version is updated for a release.
# If the version contains '-dev' (as it does on the master branch, or for development builds) then we get the latest
# published major version number by parsing a sorted list of git tags instead, to make deploying the chart from master
# work as expected.
.PHONY:helm-version
helm-version:
$(HELMJANITOR) update-version $(VERSION)
TSH_APP_PLISTS := $(wildcard build.assets/macos/*/tsh.app/Contents/Info.plist)
PLIST_FILES := $(abspath $(TSH_APP_PLISTS))
# tsh-version sets CFBundleVersion and CFBundleShortVersionString in the tsh{,dev} Info.plist
.PHONY:tsh-version
tsh-version:
GOWORK=off CGO_ENABLED=0 go -C build.assets/tooling run ./cmd/update-plist-version $(VERSION) $(PLIST_FILES)
.PHONY:validate-semver
validate-semver:
# Turning off GOWORK to prevent missing package errors.
GOWORK=off CGO_ENABLED=0 go -C build.assets/tooling run ./cmd/check -check valid -tag v$(VERSION)