diff --git a/.github/workflows/components.yaml b/.github/workflows/components.yaml index 0a5e418ab..f0e796887 100644 --- a/.github/workflows/components.yaml +++ b/.github/workflows/components.yaml @@ -89,17 +89,14 @@ jobs: - name: CTF run: | cd components/${{ matrix.component }} - ARGS="PATH=$PATH:$(go env GOPATH)/bin CTF_TYPE=${{ env.CTF_TYPE }}" - if [ -n "${{ inputs.effective-version }}" ]; then - ARGS="$ARGS EFFECTIVE_VERSION=${{ inputs.effective-version }}" - fi - if [ -n "${{ env.PLATFORMS }}" ]; then - ARGS="$ARGS PLATFORMS=${{ env.PLATFORMS }}" - fi - if [ -n "${{ env.IMAGE_PLATFORMS }}" ]; then - ARGS="$ARGS IMAGE_PLATFORMS=${{ env.IMAGE_PLATFORMS }}" - fi - $ARGS make ctf descriptor describe + + PATH=$PATH:$(go env GOPATH)/bin \ + CTF_TYPE=${{ env.CTF_TYPE }} \ + EFFECTIVE_VERSION=${{ inputs.effective-version }} \ + PLATFORMS="${{ env.PLATFORMS }}" \ + IMAGE_PLATFORMS="${{ env.IMAGE_PLATFORMS }}" \ + make \ + ctf descriptor describe - name: Upload CTF uses: actions/upload-artifact@v4 with: diff --git a/Makefile b/Makefile index 405434ff3..c5d202b4d 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,12 @@ REPO_ROOT := $(shell dirname $(realpath $(l GITHUBORG ?= open-component-model OCMREPO ?= ghcr.io/$(GITHUBORG)/ocm VERSION := $(shell go run api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) +COMMIT = $(shell git rev-parse HEAD) +# if EFFECTIVE_VERSION is not set, set it to VERSION+HEAD +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) EFFECTIVE_VERSION := $(VERSION)+$(shell git rev-parse HEAD) +endif GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty) COMMIT := $(shell git rev-parse --verify HEAD) diff --git a/components/demoplugin/Makefile b/components/demoplugin/Makefile index 024e92fb2..211a852e9 100644 --- a/components/demoplugin/Makefile +++ b/components/demoplugin/Makefile @@ -9,7 +9,11 @@ CTF_TYPE ?= directory REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../.. VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) COMMIT = $(shell git rev-parse HEAD) -EFFECTIVE_VERSION ?= $(VERSION)+$(COMMIT) +# if EFFECTIVE_VERSION is not set, set it to VERSION+COMMIT +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) +EFFECTIVE_VERSION := $(VERSION)+$(COMMIT) +endif GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty) CMDSRCS=$(shell find $(REPO_ROOT)/cmds/$(NAME) -type f) diff --git a/components/ecrplugin/Makefile b/components/ecrplugin/Makefile index cb0f76802..f5e8c2714 100644 --- a/components/ecrplugin/Makefile +++ b/components/ecrplugin/Makefile @@ -10,7 +10,11 @@ CTF_TYPE ?= directory REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../.. VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) COMMIT = $(shell git rev-parse HEAD) -EFFECTIVE_VERSION ?= $(VERSION)+$(COMMIT) +# if EFFECTIVE_VERSION is not set, set it to VERSION+COMMIT +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) +EFFECTIVE_VERSION := $(VERSION)+$(COMMIT) +endif GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty) CMDSRCS=$(shell find $(REPO_ROOT)/cmds/$(NAME) -type f) diff --git a/components/helmdemo/Makefile b/components/helmdemo/Makefile index 34da222a3..2f49401ff 100644 --- a/components/helmdemo/Makefile +++ b/components/helmdemo/Makefile @@ -10,7 +10,11 @@ HELMINSTCOMP = $(PROVIDER)/toi/installers/helminstaller REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../.. VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) COMMIT = $(shell git rev-parse HEAD) -EFFECTIVE_VERSION ?= $(VERSION)-$(COMMIT) +# if EFFECTIVE_VERSION is not set, set it to VERSION-COMMIT +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) +EFFECTIVE_VERSION := $(VERSION)-$(COMMIT) +endif HELMINSTVERSION ?= $(VERSION) CREDS ?= diff --git a/components/helminstaller/Makefile b/components/helminstaller/Makefile index 0b5dd01f9..cc51f01a8 100644 --- a/components/helminstaller/Makefile +++ b/components/helminstaller/Makefile @@ -11,7 +11,11 @@ CTF_TYPE ?= directory REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/../.. VERSION := $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) COMMIT := $(shell git rev-parse --verify HEAD) -EFFECTIVE_VERSION ?= $(VERSION)-$(COMMIT) +# if EFFECTIVE_VERSION is not set, set it to VERSION-COMMIT +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) +EFFECTIVE_VERSION := $(VERSION)-$(COMMIT) +endif GIT_TREE_STATE := $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty) PLATFORM := $(shell go env GOOS)/$(shell go env GOARCH) CACHE_DIR := $(shell go env GOCACHE) diff --git a/components/ocmcli/Makefile b/components/ocmcli/Makefile index 2ac1c8f94..3dd4df1cb 100644 --- a/components/ocmcli/Makefile +++ b/components/ocmcli/Makefile @@ -14,7 +14,11 @@ REPO_ROOT := $(dir $(realpath $(lastword $( GIT_TREE_STATE = $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty) VERSION = $(shell go run ../../api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) COMMIT = $(shell git rev-parse HEAD) -EFFECTIVE_VERSION ?= $(VERSION)+$(COMMIT) +# if EFFECTIVE_VERSION is not set, set it to VERSION+COMMIT +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) +EFFECTIVE_VERSION := $(VERSION)+$(COMMIT) +endif PLATFORM_OS := $(shell go env GOOS) PLATFORM_ARCH := $(shell go env GOARCH) diff --git a/components/subchartsdemo/Makefile b/components/subchartsdemo/Makefile index 59f424806..fef4796dd 100644 --- a/components/subchartsdemo/Makefile +++ b/components/subchartsdemo/Makefile @@ -15,7 +15,11 @@ REPO_ROOT := $(shell dirname $(realpath $(la GIT_TREE_STATE = $(shell [ -z "$$(git status --porcelain 2>/dev/null)" ] && echo clean || echo dirty) VERSION = $(shell go run $(REPO_ROOT)/api/version/generate/release_generate.go print-rc-version $(CANDIDATE)) COMMIT = $(shell git rev-parse HEAD) -EFFECTIVE_VERSION ?= $(VERSION)-$(COMMIT) +# if EFFECTIVE_VERSION is not set, set it to VERSION-COMMIT +# this is not the same as '?=' because it will also set the value if EFFECTIVE_VERSION is set to an empty string +ifeq ($(EFFECTIVE_VERSION),) +EFFECTIVE_VERSION := $(VERSION)-$(COMMIT) +endif HELMINSTVERSION ?= $(VERSION) CREDS ?=