From e4b545fb751c5e62286332696d23d80cbe387acd Mon Sep 17 00:00:00 2001
From: Paul Abel
Date: Mon, 12 Aug 2024 12:30:10 +0100
Subject: [PATCH] add operator version input to replace
---
.github/workflows/sync-chart.yml | 38 ++++++++++++++++++++++----------
1 file changed, 26 insertions(+), 12 deletions(-)
diff --git a/.github/workflows/sync-chart.yml b/.github/workflows/sync-chart.yml
index 32cc040e..c1303e69 100644
--- a/.github/workflows/sync-chart.yml
+++ b/.github/workflows/sync-chart.yml
@@ -1,4 +1,4 @@
-name: Sync Helm Chart
+name: Prepare Operator Release
on:
workflow_dispatch:
@@ -6,7 +6,9 @@ on:
chart_version:
description: "Chart version"
required: true
- default: "0.0.0"
+ operator_version:
+ description: "Operator version"
+ required: true
permissions:
contents: read
@@ -31,8 +33,11 @@ jobs:
- name: Sync
id: sync
run: |
- current_version=$(yq e '.appVersion' helm-charts/nginx-ingress/Chart.yaml)
- echo "Current NIC version: $current_version"
+ current_nic_version=$(yq e '.appVersion' helm-charts/nginx-ingress/Chart.yaml)
+ echo "Current NIC version: $current_nic_version"
+
+ current_operator_version=$(egrep '^VERSION' Makefile | awk '{ print $3 }')
+ echo "Current Operator version: $current_operator_version"
cd helm-charts/
schema_dir=$(cd nginx-ingress && echo v1.*)
@@ -46,17 +51,26 @@ jobs:
sed -i '14s/name: {{ include "nginx-ingress.fullname" . }}/name: nginx-ingress-operator-nginx-ingress-admin/' nginx-ingress/templates/clusterrolebinding.yaml
mv $schema_dir nginx-ingress/
- new_version=$(yq e '.appVersion' nginx-ingress/Chart.yaml)
- echo "New NIC version: $new_version"
+ new_nic_version=$(yq e '.appVersion' nginx-ingress/Chart.yaml)
+ echo "New NIC version: $new_nic_version"
+
+ echo current_nic_version=$current_nic_version >> $GITHUB_OUTPUT
+ echo current_operator_version=$current_operator_version >> $GITHUB_OUTPUT
+ echo new_nic_version=$new_nic_version >> $GITHUB_OUTPUT
+ echo new_operator_version=${{ inputs.operator_version }} >> $GITHUB_OUTPUT
- echo current_version=$current_version >> $GITHUB_OUTPUT
- echo new_version=$new_version >> $GITHUB_OUTPUT
+ - name: Find and Replace NIC version
+ uses: jacobtomlinson/gha-find-replace@a51bbcd94d000df9ca0fcb54ec8be69aad8374b0 # v3.0.2
+ with:
+ find: ${{ steps.sync.outputs.current_nic_version }}
+ replace: ${{ steps.sync.outputs.new_nic_version }}
+ regex: false
- - name: Find and Replace
- uses: jacobtomlinson/gha-find-replace@099c88fbf2a7da26b083521a8bfa13e4f0886b97 # v3.0.3
+ - name: Find and Replace Operator version
+ uses: jacobtomlinson/gha-find-replace@a51bbcd94d000df9ca0fcb54ec8be69aad8374b0 # v3.0.2
with:
- find: ${{ steps.sync.outputs.current_version }}
- replace: ${{ steps.sync.outputs.new_version }}
+ find: ${{ steps.sync.outputs.current_operator_version }}
+ replace: ${{ steps.sync.outputs.new_operator_version }}
regex: false
- name: Create Pull Request