Skip to content

Commit

Permalink
[release-v0.1] update release.yml (#8)
Browse files Browse the repository at this point in the history
* update release.yml

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* set image tag only when not set

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* no longer set IMAGE_TAG as part of release target

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

* update makefile to set release env vars if not already set

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>

---------

Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
Co-authored-by: Bryce Palmer <bpalmer@redhat.com>
  • Loading branch information
openshift-cherrypick-robot and everettraven committed Sep 7, 2023
1 parent d8db898 commit f5068cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit f5068cc

Please sign in to comment.