Skip to content

Commit f64b1ba

Browse files
authored
chore: bump Helm chart to appVersion 0.33.0 and trigger release workflow (#910)
1 parent 87587eb commit f64b1ba

4 files changed

Lines changed: 81 additions & 80 deletions

File tree

.github/workflows/release-helm-chart.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,21 @@ jobs:
5252
ct_configfile: charts/cloudcost-exporter/ct.yaml
5353
secrets:
5454
vault_repo_secret_name: github-app
55+
56+
trigger-deployment-tools-update:
57+
needs: release-chart
58+
runs-on: ubuntu-latest
59+
permissions:
60+
contents: read
61+
id-token: write
62+
steps:
63+
- name: Trigger chartfile version update in deployment-tools
64+
uses: grafana/shared-workflows/actions/trigger-argo-workflow@b513eb1dfd9becfa671a41e55063cdd5c0a08031 # trigger-argo-workflow/v1.2.2
65+
with:
66+
namespace: platform-monitoring-cd
67+
workflow_template: chartfile-version-update
68+
parameters: |
69+
chartfile_file=ksonnet/lib/cloudcost-exporter/chartfile.yaml
70+
chart_name=grafana/cloudcost-exporter
71+
workflow_name=cloudcost-exporter-gh-runners
72+
workflow_namespace=platform-monitoring-cd

.github/workflows/release-on-pr-merge.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,67 @@ jobs:
233233
tags: |
234234
type=raw,value=${{ needs.tag-and-goreleaser.outputs.version }}
235235
236+
update-helm-chart:
237+
if: needs.tag-and-goreleaser.outputs.should-release == 'true'
238+
needs: [check-release-label, tag-and-goreleaser, push-manifest]
239+
runs-on: ubuntu-latest
240+
permissions:
241+
contents: read
242+
id-token: write
243+
pull-requests: write
244+
steps:
245+
- name: Checkout
246+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
247+
with:
248+
persist-credentials: false
249+
250+
- name: Install yq
251+
env:
252+
YQ_VERSION: v4.44.3
253+
YQ_SHA256: a2c097180dd884a8d50c956ee16a9cec070f30a7947cf4ebf87d5f36213e9ed7
254+
run: |
255+
wget -qO /tmp/yq \
256+
"https://github.com/mikefarah/yq/releases/download/${YQ_VERSION}/yq_linux_amd64"
257+
echo "${YQ_SHA256} /tmp/yq" | sha256sum -c
258+
sudo mv /tmp/yq /usr/local/bin/yq
259+
sudo chmod +x /usr/local/bin/yq
260+
261+
- name: Update Chart.yaml
262+
id: update-versions
263+
env:
264+
APP_VERSION: ${{ needs.tag-and-goreleaser.outputs.version }}
265+
run: |
266+
APP_VERSION="${APP_VERSION#v}"
267+
268+
yq -i ".appVersion = \"${APP_VERSION}\"" charts/cloudcost-exporter/Chart.yaml
269+
yq -i '.version |= (split(".") | .[2] = (.[2] | tonumber + 1 | tostring) | join("."))' charts/cloudcost-exporter/Chart.yaml
270+
271+
echo "app_version=${APP_VERSION}" >> "$GITHUB_OUTPUT"
272+
echo "chart_version=$(yq '.version' charts/cloudcost-exporter/Chart.yaml)" >> "$GITHUB_OUTPUT"
273+
274+
- name: Get GitHub App token
275+
id: get-github-app-token
276+
uses: grafana/shared-workflows/actions/create-github-app-token@ae92934a14a48b94494dbc06d74a81d47fe08a40 # create-github-app-token/v0.2.2
277+
with:
278+
github_app: github-app
279+
280+
- name: Create pull request
281+
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
282+
with:
283+
token: ${{ steps.get-github-app-token.outputs.github_token }}
284+
branch: helm-chart/update-to-${{ steps.update-versions.outputs.app_version }}
285+
delete-branch: true
286+
base: main
287+
commit-message: "Update Helm chart appVersion to ${{ steps.update-versions.outputs.app_version }}"
288+
title: "Update Helm chart to appVersion ${{ steps.update-versions.outputs.app_version }}"
289+
body: |
290+
Automated update triggered by release `${{ needs.tag-and-goreleaser.outputs.version }}`.
291+
292+
- `appVersion`: updated to `${{ steps.update-versions.outputs.app_version }}`
293+
- `version`: bumped to `${{ steps.update-versions.outputs.chart_version }}`
294+
295+
Once merged, the [Release Helm Chart](https://github.com/grafana/cloudcost-exporter/actions/workflows/release-helm-chart.yaml) workflow will publish the updated Helm chart.
296+
236297
deploy:
237298
if: needs.tag-and-goreleaser.outputs.should-release == 'true'
238299
needs: [check-release-label, tag-and-goreleaser, push-manifest]

.github/workflows/update-helm-chart-on-release.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

charts/cloudcost-exporter/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ type: application
55

66
# This is the chart version. This version number should be incremented each time you make changes
77
# to the chart and its templates, including the app version.
8-
version: 1.1.2
8+
version: 1.1.3
99

1010
# This is the version of cloudcost-exporter to be deployed, which should be incremented
1111
# with each release.
12-
appVersion: "0.25.0"
12+
appVersion: "0.33.0"
1313

1414
home: https://github.com/grafana/cloudcost-exporter

0 commit comments

Comments
 (0)