Skip to content

Commit e4d773a

Browse files
Rework helmchart release (#30)
1 parent 39916da commit e4d773a

4 files changed

Lines changed: 30 additions & 16 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,13 +100,11 @@ jobs:
100100
- name: Check helmchart generated
101101
run: make generate-helmchart && git diff --exit-code
102102
- name: Install Helm
103-
run: |
104-
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
103+
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
105104
- name: Verify Helm installation
106105
run: helm version
107106
- name: Lint Helm Chart
108-
run: |
109-
helm lint ./dist/chart
107+
run: helm lint ./dist/chart
110108
- name: Create k8s Kind Cluster
111109
uses: helm/kind-action@v1
112110
with:

.github/workflows/release.yaml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ env:
99
IMAGE_NAME: clickhouse/clickhouse-operator
1010
IMAGE_TAG_BASE: ghcr.io/clickhouse/clickhouse-operator/clickhouse-operator
1111
VERSION: ${{ github.ref_name }}
12+
# Tempora ry address while repo is private
13+
PAGES_URL: https://solid-adventure-16rp7jv.pages.github.io/
1214

1315
jobs:
1416
release:
@@ -31,8 +33,14 @@ jobs:
3133
registry: ${{ env.REGISTRY }}
3234
username: ${{ github.actor }}
3335
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Install Helm
37+
run: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
38+
- name: Verify Helm installation
39+
run: helm version
40+
3441
- name: Set VERSION
3542
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
43+
3644
- name: Build operator image
3745
run: make docker-buildx
3846
- name: Build operator bundle image
@@ -45,19 +53,12 @@ jobs:
4553
kustomize_version: 5.7.1
4654
kustomize_build_dir: "config/default"
4755
kustomize_output_file: "dist/clickhouse-operator.yaml"
48-
- name: Run chart-releaser
49-
uses: helm/chart-releaser-action@v1.7.0
50-
env:
51-
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
52-
with:
53-
charts_dir: dist/chart
54-
packages_with_index: true
55-
mark_as_latest: true
56-
pages_branch: helm-releases
56+
- name: Package helm chart
57+
run: helm package --version ${VERSION} --app-version v${VERSION} -d dist/chart
58+
5759
- name: Create GitHub Release
5860
uses: softprops/action-gh-release@v1
5961
with:
60-
draft: true
6162
tag_name: ${{ github.ref_name }}
6263
name: ${{github.ref_name }}
6364
body: |
@@ -72,4 +73,17 @@ jobs:
7273
```
7374
generate_release_notes: true
7475
append_body: true
75-
files: dist/clickhouse-operator.yaml
76+
files: |
77+
dist/clickhouse-operator.yaml
78+
dist/chart/clickhouse-operator-${VERSION}.tgz
79+
- name: Checkout helm-releases branch
80+
run: |
81+
git config user.name "github-actions[bot]"
82+
git config user.email "github-actions[bot]@users.noreply.github.com"
83+
git fetch origin helm-releases
84+
git checkout helm-releases
85+
helm repo index --url "${PAGES_URL}/dist/chart" dist/chart
86+
git add dist/chart/index.yaml
87+
git add dist/chart/clickhouse-operator-${VERSION}.tgz
88+
git commit -m "Add chart $GITHUB_REF_NAME"
89+
git push origin helm-releases

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*.dylib
77
bin/*
88
Dockerfile.cross
9+
dist/chart/*.tgz
10+
dist/chart/index.yaml
911

1012
# Test binary, built with `go test -c`
1113
*.test

dist/chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ name: clickhouse-operator
33
description: A Helm chart for clickhouse-operator
44
type: application
55
version: 0.0.1
6-
appVersion: "0.0.1"
6+
appVersion: "latest"
77
icon: "https://clickhouse.com/favicons/favicon.svg"

0 commit comments

Comments
 (0)