diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 28b318b96..3c4994574 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -39,12 +39,12 @@ jobs: if [[ $GITHUB_REF == refs/tags/* ]]; then # Release tags. echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - echo GORELEASER_ARGS="--rm-dist" >> $GITHUB_ENV - echo DISABLE_RELEASE_PIPELINE=false >> $GITHUB_ENV + echo GORELEASER_ARGS="--clean" >> $GITHUB_ENV + echo ENABLE_RELEASE_PIPELINE=true >> $GITHUB_ENV elif [[ $GITHUB_REF == refs/heads/* ]]; then # Branch build. echo IMAGE_TAG="$(echo "${GITHUB_REF#refs/heads/}" | sed -r 's|/+|-|g')" >> $GITHUB_ENV - echo GORELEASER_ARGS="--rm-dist --skip-validate" >> $GITHUB_ENV + echo GORELEASER_ARGS="--clean --skip-validate" >> $GITHUB_ENV elif [[ $GITHUB_REF == refs/pull/* ]]; then # PR build. echo IMAGE_TAG="pr-$(echo "${GITHUB_REF}" | sed -E 's|refs/pull/([^/]+)/?.*|\1|')" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index a0c393786..56a86e3a4 100644 --- a/.gitignore +++ b/.gitignore @@ -18,7 +18,6 @@ Dockerfile.cross # Release output dist/** -.goreleaser.yml operator-controller.yaml # Kubernetes Generated files - skip generated files, except for vendored files diff --git a/.goreleaser.template.yml b/.goreleaser.yml similarity index 95% rename from .goreleaser.template.yml rename to .goreleaser.yml index e1f045422..7a8fcec86 100644 --- a/.goreleaser.template.yml +++ b/.goreleaser.yml @@ -54,9 +54,9 @@ snapshot: name_template: "{{ incpatch .Version }}-next" changelog: use: github-native - skip: $DISABLE_RELEASE_PIPELINE + skip: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}' release: - disable: $DISABLE_RELEASE_PIPELINE + disable: '{{ ne .Env.ENABLE_RELEASE_PIPELINE "true" }}' extra_files: - glob: 'operator-controller.yaml' header: | diff --git a/Makefile b/Makefile index 1d90c1cea..a229fbabb 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ export IMAGE_REPO ?= quay.io/operator-framework/operator-controller export IMAGE_TAG ?= devel export GO_BUILD_TAGS ?= upstream export CERT_MGR_VERSION ?= v1.9.0 -export GORELEASER_VERSION ?= v1.15.2 +export GORELEASER_VERSION ?= v1.16.2 export WAIT_TIMEOUT ?= 60s IMG?=$(IMAGE_REPO):$(IMAGE_TAG) @@ -95,7 +95,7 @@ kind-cluster-cleanup: kind ## Delete the kind cluster ##@ Build .PHONY: build -build: manifests generate fmt vet substitute goreleaser ## Build manager binary using goreleaser for current GOOS and GOARCH. +build: manifests generate fmt vet goreleaser ## Build manager binary using goreleaser for current GOOS and GOARCH. ${GORELEASER} build ${GORELEASER_ARGS} --single-target -o bin/manager .PHONY: run @@ -135,13 +135,10 @@ docker-buildx: test ## Build and push docker image for the manager for cross-pla ########### ##@ Release: -export DISABLE_RELEASE_PIPELINE ?= true -export GORELEASER_ARGS ?= --snapshot --rm-dist +export ENABLE_RELEASE_PIPELINE ?= false +export GORELEASER_ARGS ?= --snapshot --clean -substitute: - envsubst < .goreleaser.template.yml > .goreleaser.yml - -release: substitute goreleaser ## Runs goreleaser for the operator-controller. By default, this will run only as a snapshot and will not publish any artifacts unless it is run with different arguments. To override the arguments, run with "GORELEASER_ARGS=...". When run as a github action from a tag, this target will publish a full release. +release: goreleaser ## Runs goreleaser for the operator-controller. By default, this will run only as a snapshot and will not publish any artifacts unless it is run with different arguments. To override the arguments, run with "GORELEASER_ARGS=...". When run as a github action from a tag, this target will publish a full release. $(GORELEASER) $(GORELEASER_ARGS) quickstart: VERSION ?= $(shell git describe --abbrev=0 --tags)