Skip to content

Commit 6908663

Browse files
authored
update the helm.yml workflow to now publish helm charts from feature branches without bumping up the chart version (#242)
<!--- Note to EXTERNAL Contributors --> <!-- Thanks for opening a PR! If it is a significant code change, please **make sure there is an open issue** for this. We work best with you when we have accepted the idea first before you code. --> <!--- For ALL Contributors 👇 --> ## What was changed - WISOTT ## Why? - We want to be able to now publish a helm chart from a tag, which shall be cut from a release branch, so that we can fix the divergence between our appVersion and our helm chart version. ## Checklist <!--- add/delete as needed ---> 1. Closes <!-- add issue number here --> 2. How was this tested: <!--- Please describe how you tested your changes/how we can test them --> 3. Any docs updates needed? <!--- update README if applicable or point out where to update docs.temporal.io -->
1 parent c59e749 commit 6908663

1 file changed

Lines changed: 29 additions & 10 deletions

File tree

.github/workflows/helm.yml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ on:
44
workflow_dispatch:
55
inputs:
66
version_bump:
7-
description: 'Type of version bump to perform'
7+
description: 'Type of helm chart version bump to perform (none = publish as-is)'
88
required: true
99
default: 'patch'
1010
type: choice
1111
options:
12+
- none
1213
- patch
1314
- minor
1415
- major
16+
ref:
17+
description: 'Branch or tag to publish from (defaults to main)'
18+
required: false
19+
default: 'main'
20+
type: string
1521

1622
permissions:
1723
contents: read
@@ -32,6 +38,7 @@ jobs:
3238
uses: actions/checkout@v4
3339
with:
3440
token: ${{ steps.generate_token.outputs.token }}
41+
ref: ${{ inputs.ref }}
3542
fetch-depth: 0
3643

3744
- name: Configure Git
@@ -50,9 +57,15 @@ jobs:
5057
VERSION_BUMP: ${{ inputs.version_bump }}
5158
run: |
5259
# Get current version from Chart.yaml
53-
CURRENT_VERSION=$(grep 'version:' helm/temporal-worker-controller/Chart.yaml | awk '{print $2}')
60+
CURRENT_VERSION=$(grep '^version:' helm/temporal-worker-controller/Chart.yaml | awk '{print $2}')
5461
echo "Current version: $CURRENT_VERSION"
5562
63+
if [[ "${VERSION_BUMP}" == "none" ]]; then
64+
echo "No version bump requested, publishing existing version: $CURRENT_VERSION"
65+
echo "version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
66+
exit 0
67+
fi
68+
5669
# Split version into parts
5770
IFS='.' read -r -a VERSION_PARTS <<< "$CURRENT_VERSION"
5871
MAJOR=${VERSION_PARTS[0]}
@@ -77,15 +90,17 @@ jobs:
7790
# Update Chart.yaml with new version
7891
sed -i "s/version: $CURRENT_VERSION/version: $NEW_VERSION/g" helm/temporal-worker-controller/Chart.yaml
7992
80-
# Also bump CRDs chart version
81-
sed -i "s/version: $CURRENT_VERSION/version: $NEW_VERSION/g" helm/temporal-worker-controller-crds/Chart.yaml
93+
# Also bump CRDs chart version if it exists
94+
if [ -f helm/temporal-worker-controller-crds/Chart.yaml ]; then
95+
sed -i "s/version: $CURRENT_VERSION/version: $NEW_VERSION/g" helm/temporal-worker-controller-crds/Chart.yaml
96+
git add helm/temporal-worker-controller-crds/Chart.yaml
97+
fi
8298
8399
# Set output variable for use in later steps
84100
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
85101
86-
# Commit both Chart.yaml files
102+
# Commit Chart.yaml files
87103
git add helm/temporal-worker-controller/Chart.yaml
88-
git add helm/temporal-worker-controller-crds/Chart.yaml
89104
git commit -m "Bump chart version to $NEW_VERSION [skip ci]"
90105
git push
91106
@@ -102,10 +117,14 @@ jobs:
102117
VERSION=${{ steps.bump_version.outputs.version }}
103118
echo "Chart version: $VERSION"
104119
105-
# Package and push the CRDs chart
106-
helm package ./helm/temporal-worker-controller-crds
107-
helm push temporal-worker-controller-crds-${VERSION}.tgz oci://docker.io/temporalio
108-
echo "✅ CRDs chart pushed successfully to oci://docker.io/temporalio/temporal-worker-controller-crds:${VERSION}"
120+
# Package and push the CRDs chart if it exists
121+
if [ -d "./helm/temporal-worker-controller-crds" ]; then
122+
helm package ./helm/temporal-worker-controller-crds
123+
helm push temporal-worker-controller-crds-${VERSION}.tgz oci://docker.io/temporalio
124+
echo "✅ CRDs chart pushed successfully to oci://docker.io/temporalio/temporal-worker-controller-crds:${VERSION}"
125+
else
126+
echo "⚠️ CRDs chart not found, skipping"
127+
fi
109128
110129
# Package and push the controller chart
111130
helm package ./helm/temporal-worker-controller

0 commit comments

Comments
 (0)