Skip to content

Commit

Permalink
add operator version input to replace
Browse files Browse the repository at this point in the history
  • Loading branch information
pdabelf5 committed Aug 12, 2024
1 parent 1624185 commit e4b545f
Showing 1 changed file with 26 additions and 12 deletions.
38 changes: 26 additions & 12 deletions .github/workflows/sync-chart.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
name: Sync Helm Chart
name: Prepare Operator Release

on:
workflow_dispatch:
inputs:
chart_version:
description: "Chart version"
required: true
default: "0.0.0"
operator_version:
description: "Operator version"
required: true

permissions:
contents: read
Expand All @@ -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.*)
Expand All @@ -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
Expand Down

0 comments on commit e4b545f

Please sign in to comment.