From 993f3f7917c8542e95ce189fabd06f16c7ae004c Mon Sep 17 00:00:00 2001 From: Bryce Palmer Date: Wed, 6 Sep 2023 16:46:37 -0400 Subject: [PATCH] update release.yml (#7) * fix release.yml Signed-off-by: Bryce Palmer --- .github/workflows/release.yml | 6 +++--- Makefile | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1f33de1..d45db71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,16 +40,16 @@ jobs: - name: Set the release related variables run: | - if [[ "${GITHUB_REF}" == "refs/tags/*" ]]; then + if [[ $GITHUB_REF == refs/tags/* ]]; then # Release tags. echo IMAGE_TAG="${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV echo GORELEASER_ARGS="--clean --timeout=120m" >> $GITHUB_ENV echo ENABLE_RELEASE_PIPELINE=true >> $GITHUB_ENV - elif [[ "${GITHUB_REF}" == "refs/heads/*" ]]; then + 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="--clean --skip-validate --timeout=120m" >> $GITHUB_ENV - elif [[ "${GITHUB_REF}" == "refs/pull/*" ]]; then + elif [[ $GITHUB_REF == refs/pull/* ]]; then # PR build. echo IMAGE_TAG="pr-$(echo "${GITHUB_REF}" | sed -E 's|refs/pull/([^/]+)/?.*|\1|')" >> $GITHUB_ENV else diff --git a/Makefile b/Makefile index bccf587..ce2384c 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ export GO111MODULE = on export CGO_ENABLED = 0 export PATH := $(PWD)/$(BUILD_DIR):$(PWD)/$(TOOLS_DIR):$(PATH) -export IMAGE_REPO = quay.io/operator-framework/ansible-operator-plugins -export IMAGE_TAG = dev +export IMAGE_REPO ?= quay.io/operator-framework/ansible-operator-plugins +export IMAGE_TAG ?= dev ##@ Development @@ -176,7 +176,6 @@ goreleaser: $(LOCALBIN) ## Build a local copy of goreleaser export ENABLE_RELEASE_PIPELINE ?= false export GORELEASER_ARGS ?= --snapshot --clean --timeout=120m -release: IMAGE_TAG = $(GIT_VERSION) release: goreleaser ## Runs goreleaser. 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)