Skip to content

Commit

Permalink
Fixes pre-release action by generating correct manifest (#2026)
Browse files Browse the repository at this point in the history
* Fixes github pre-release action that created wrong manifests

* Adapt config.mk to being configurable by using env var

* Reintroduce accidentally deleted stuff

* Adapt config.mk file to check whether env var is set

* Fix wrong name

---------

Co-authored-by: Lukas Hinterreiter <90035514+luhi-DT@users.noreply.github.com>
  • Loading branch information
waodim and luhi-DT committed Aug 8, 2023
1 parent b05974d commit b9bd795
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ jobs:
run: |
export "IMAGE=${{ matrix.url }}/${{ secrets[matrix.repository] }}"
export "TAG=$(echo "${{ github.ref }}" | awk -F"/" '{print $3}')"
export "CHART_VERSION=$(echo "${{ github.ref_name }}")"
make manifests
- name: Generate CRD
run: make manifests/crd/release
Expand All @@ -280,12 +281,8 @@ jobs:
with:
body_path: ./CHANGELOG.md
files: |
config/deploy/kubernetes/gke-autopilot.yaml
config/deploy/kubernetes/kubernetes-csi.yaml
config/deploy/kubernetes/kubernetes.yaml
config/deploy/openshift/openshift-csi.yaml
config/deploy/openshift/openshift.yaml
config/deploy/dynatrace-operator-crd.yaml
config/deploy/kubernetes/kubernetes-all.yaml
config/deploy/openshift/openshift-all.yaml
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
draft: true
Expand Down
22 changes: 12 additions & 10 deletions hack/make/manifests/config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,19 @@ OPENSHIFT_CSIDRIVER_YAML=$(MANIFESTS_DIR)openshift/openshift-csi.yaml
OPENSHIFT_OLM_YAML=$(MANIFESTS_DIR)openshift/openshift-olm.yaml
OPENSHIFT_ALL_YAML=$(MANIFESTS_DIR)openshift/openshift-all.yaml

ifneq ($(shell git branch --show-current | grep "^release-"),)
# if the current branch is a release branch
ifneq ($(shell grep "^version:" $(HELM_CHART_DEFAULT_DIR)/Chart.yaml | grep snapshot),)
CHART_VERSION=$(shell git branch --show-current | cut -d'-' -f2-).0
ifeq ($(shell echo $CHART_VERSION),)
ifneq ($(shell git branch --show-current | grep "^release-"),)
# if the current branch is a release branch
ifneq ($(shell grep "^version:" $(HELM_CHART_DEFAULT_DIR)/Chart.yaml | grep snapshot),)
CHART_VERSION=$(shell git branch --show-current | cut -d'-' -f2-).0
else
CHART_VERSION=
endif
else ifeq ($(shell git branch --show-current), main)
# if the current branch is the main branch
CHART_VERSION=0.0.0-snapshot
else
# otherwise do not change Chart.yaml
CHART_VERSION=
endif
else ifeq ($(shell git branch --show-current), main)
# if the current branch is the main branch
CHART_VERSION=0.0.0-snapshot
else
# otherwise do not change Chart.yaml
CHART_VERSION=
endif

0 comments on commit b9bd795

Please sign in to comment.