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

bump goreleaser, remove obsolete substitute task #147

Merged
merged 1 commit into from
Mar 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ Dockerfile.cross

# Release output
dist/**
.goreleaser.yml
operator-controller.yaml

# Kubernetes Generated files - skip generated files, except for vendored files
Expand Down
4 changes: 2 additions & 2 deletions .goreleaser.template.yml → .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
13 changes: 5 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

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