Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[makefile] Support for sed on Darwin #1920

Merged
merged 2 commits into from Apr 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions Makefile
Expand Up @@ -84,7 +84,16 @@ SHELL = /usr/bin/env bash -o pipefail

# Setting SED allows macos users to install GNU sed and use the latter
# instead of the default BSD sed.
SED ?= /usr/bin/sed
SED := /usr/bin/sed
vladikkuzn marked this conversation as resolved.
Show resolved Hide resolved
# If the OS is Darwin (MacOS)
ifeq ($(shell uname), Darwin)
# Check if gsed is available
ifeq ($(shell command -v gsed 2>/dev/null),)
$(error "gsed could not be found, please install it.")
endif
# Set SED to gsed if available
SED := $(shell which gsed)
endif

version_pkg = sigs.k8s.io/kueue/pkg/version
LD_FLAGS += -X '$(version_pkg).GitVersion=$(GIT_TAG)'
Expand Down Expand Up @@ -307,7 +316,7 @@ artifacts: kustomize yq helm

.PHONY: prepare-release-branch
prepare-release-branch: yq kustomize
sed -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/hugo.toml
$(SED) -r 's/v[0-9]+\.[0-9]+\.[0-9]+/$(RELEASE_VERSION)/g' -i README.md -i site/hugo.toml
vladikkuzn marked this conversation as resolved.
Show resolved Hide resolved
$(YQ) e '.appVersion = "$(RELEASE_VERSION)"' -i charts/kueue/Chart.yaml
@$(call clean-manifests)

Expand Down