Skip to content

Commit aa577da

Browse files
committed
switch to release branches
1 parent 9772578 commit aa577da

File tree

1 file changed

+28
-10
lines changed

1 file changed

+28
-10
lines changed

.github/workflows/helm-release.yaml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Release Helm
22

33
on:
44
push:
5-
tags:
6-
- '*/v*'
5+
branches:
6+
- 'releases/*/v*'
77

88
jobs:
99
release:
@@ -19,6 +19,9 @@ jobs:
1919
with:
2020
version: v3.10.0
2121

22+
- name: Install yq
23+
uses: mikefarah/yq@v4.44.6
24+
2225
- name: Login to mrmhub
2326
run: |
2427
echo '${{ secrets.MRMHUB_PASSWORD }}' | helm registry login mrmhub.io --username '${{ secrets.MRMHUB_USERNAME }}' --password-stdin
@@ -27,14 +30,29 @@ jobs:
2730
id: chart_meta
2831
run: |
2932
cat >> "$GITHUB_OUTPUT" <<EOF
30-
chart_name=$(cut -d / -f 3 <<<"${{ github.ref }}")
31-
chart_version=$(cut -d / -f 4- <<<"${{ github.ref }}")
33+
chart_name=$(cut -d / -f 4 <<<"${{ github.ref }}")
34+
chart_version=$(cut -d / -f 5- <<<"${{ github.ref }}")
3235
EOF
3336
34-
- name: Package chart
35-
run: |
36-
helm package "${{ steps.chart_meta.outputs.chart_name }}" --version "${{ steps.chart_meta.outputs.chart_version }}"
37-
38-
- name: Upload chart
37+
- name: Update chart version
3938
run: |
40-
helm push "${{ steps.chart_meta.outputs.chart_name }}-${{ steps.chart_meta.outputs.chart_version }}.tgz" oci://mrmhub.io/mikemrm
39+
chart_file="${{ steps.chart_meta.outputs.chart_name }}/Chart.yaml"
40+
41+
yq '.version = "${{ steps.chart_meta.outputs.chart_version }}"' \
42+
"${chart_file}" > "${chart_file}.updated"
43+
44+
if diff -q "${chart_file}" "${chart_file}.updated"; then
45+
mv -f "${chart_file}.update" "${chart_file}"
46+
fi
47+
48+
make helm-docs
49+
50+
make diff
51+
52+
# - name: Package chart
53+
# run: |
54+
# helm package "${{ steps.chart_meta.outputs.chart_name }}" --version "${{ steps.chart_meta.outputs.chart_version }}"
55+
56+
# - name: Upload chart
57+
# run: |
58+
# helm push "${{ steps.chart_meta.outputs.chart_name }}-${{ steps.chart_meta.outputs.chart_version }}.tgz" oci://mrmhub.io/mikemrm

0 commit comments

Comments
 (0)