Skip to content

Commit fb3bc4d

Browse files
authored
ci: publish the kobe Helm chart as an OCI artifact on a helm_v* tag (#46)
The chart only exists as source in charts/kobe, so installing kobe means cloning the repo. Publish it to Docker Hub as an OCI artifact so users can `helm install oci://registry-1.docker.io/zondax/kobe --version <x>`. Chart releases ride their own tag (helm_v<chart-version>), decoupled from the operator's v* releases and reusing the existing Docker Hub credentials. Before pushing, the workflow asserts the tag version equals the chart's version: and that the operator image for the chart's appVersion already exists, so a published chart can never carry a mismatched version or point at an unbuilt operator image.
1 parent f56f7ed commit fb3bc4d

1 file changed

Lines changed: 62 additions & 0 deletions

File tree

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish Helm Chart
2+
3+
# Chart releases ride their own tag, decoupled from the operator's v* release
4+
# tags: push a `helm_v<chart-version>` tag (e.g. helm_v0.0.1) to publish the
5+
# chart. The tag version must match `version:` in charts/kobe/Chart.yaml, so the
6+
# published OCI version and the chart's declared version can never drift.
7+
on:
8+
push:
9+
tags: ["helm_v*"]
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: publish-chart-${{ github.ref }}
14+
cancel-in-progress: false
15+
16+
jobs:
17+
publish-chart:
18+
runs-on: kunobi-runners
19+
timeout-minutes: 15
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: azure/setup-helm@v4
24+
25+
- name: Assert tag version matches Chart.yaml
26+
if: startsWith(github.ref, 'refs/tags/helm_v')
27+
env:
28+
REF_NAME: ${{ github.ref_name }}
29+
run: |
30+
tag_version="${REF_NAME#helm_v}"
31+
chart_version="$(grep -E '^version:' charts/kobe/Chart.yaml | awk '{print $2}' | tr -d '"')"
32+
echo "tag version: $tag_version | Chart.yaml version: $chart_version"
33+
if [ "$tag_version" != "$chart_version" ]; then
34+
echo "::error::tag $REF_NAME (version $tag_version) does not match charts/kobe/Chart.yaml version $chart_version"
35+
exit 1
36+
fi
37+
38+
- uses: docker/login-action@v3
39+
with:
40+
username: ${{ secrets.DOCKERHUB_USER }}
41+
password: ${{ secrets.DOCKERHUB_TOKEN }}
42+
43+
- name: Verify the operator image exists for this appVersion
44+
run: |
45+
app_version="$(grep -E '^appVersion:' charts/kobe/Chart.yaml | awk '{print $2}' | tr -d '"')"
46+
image="zondax/kobe-operator:${app_version}"
47+
echo "Checking $image exists..."
48+
if ! docker manifest inspect "$image" >/dev/null 2>&1; then
49+
echo "::error::operator image $image not found — cut the operator release (v${app_version}) before tagging the chart"
50+
exit 1
51+
fi
52+
53+
- name: Package & push Helm chart (OCI)
54+
env:
55+
DOCKERHUB_USER: ${{ secrets.DOCKERHUB_USER }}
56+
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
57+
run: |
58+
helm registry login registry-1.docker.io -u "$DOCKERHUB_USER" -p "$DOCKERHUB_TOKEN"
59+
helm repo add bitnami https://charts.bitnami.com/bitnami
60+
helm dependency build charts/kobe
61+
helm package charts/kobe
62+
helm push kobe-*.tgz oci://registry-1.docker.io/zondax

0 commit comments

Comments
 (0)