From d632a1be641f3d5e64564b339f74b91132a1a286 Mon Sep 17 00:00:00 2001 From: Blagoj Atanasovski Date: Thu, 16 Jan 2025 15:33:05 +0100 Subject: [PATCH] Reorganize scripts so that chart version is updated on release --- .github/workflows/bump_chart.py | 4 ++- .github/workflows/publish-chart-in-cast.yaml | 4 +++ charts/temporal/Chart.yaml | 31 ++++++++++---------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/.github/workflows/bump_chart.py b/.github/workflows/bump_chart.py index c9fd3893..33376cb0 100644 --- a/.github/workflows/bump_chart.py +++ b/.github/workflows/bump_chart.py @@ -18,13 +18,15 @@ # Auto bump version patch. match = re.search(r'version:\s*(.+)', chart_yaml) + if match: current_version = match.group(1) print(f'Current version: {current_version}') updated_yaml = updated_yaml.replace(current_version, new_chart_version) print(f'Updated version: {new_chart_version}') - +else: + raise 'version field not found in Chart.yaml' with open(chart_yaml_path, 'w') as chart_file: chart_file.write(updated_yaml) \ No newline at end of file diff --git a/.github/workflows/publish-chart-in-cast.yaml b/.github/workflows/publish-chart-in-cast.yaml index 00a0b206..2a93153d 100644 --- a/.github/workflows/publish-chart-in-cast.yaml +++ b/.github/workflows/publish-chart-in-cast.yaml @@ -26,6 +26,10 @@ jobs: - name: Checkout uses: actions/checkout@v4 + - name: Get release tag + if: github.event_name == 'release' + run: echo "RELEASE_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV + - name: Checkout helm-charts if: ${{ github.event_name == 'release' }} # The cr tool only works if the target repository is already checked out diff --git a/charts/temporal/Chart.yaml b/charts/temporal/Chart.yaml index f8c68b85..45c6a18f 100644 --- a/charts/temporal/Chart.yaml +++ b/charts/temporal/Chart.yaml @@ -2,6 +2,21 @@ apiVersion: v2 name: temporal description: Temporal is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way. home: https://temporal.io/ +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +version: 1.2.3 +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. +appVersion: 1.26.2 keywords: - temporal - workflow @@ -28,18 +43,4 @@ dependencies: repository: https://grafana.github.io/helm-charts version: 8.0.2 condition: grafana.enabled -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. -type: application -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -version: 0.54.0 -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. -appVersion: 1.26.2 +