Skip to content

Commit c2065db

Browse files
committed
ci: Release OCI Helm Chart
1 parent 1f35b61 commit c2065db

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

.github/workflows/release.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,9 @@ jobs:
4949
key: ${{ runner.os }}-goreleaser-${{ hashFiles('**/go.sum') }}
5050
restore-keys: |
5151
${{ runner.os }}-goreleaser-
52-
- name: Generate release artifacts
53-
if: startsWith(github.ref, 'refs/tags/v')
52+
- name: Generate helm package
5453
run: |
55-
mkdir -p config/release
56-
kustomize build ./config/crd > ./config/release/${{ env.CONTROLLER }}.crds.yaml
57-
kustomize build ./config/manager > ./config/release/${{ env.CONTROLLER }}.deployment.yaml
58-
echo '[CHANGELOG](https://github.com/kluctl/${{ env.CONTROLLER }}/blob/main/CHANGELOG.md)' > ./config/release/notes.md
54+
make helm-package
5955
- name: Run GoReleaser
6056
if: startsWith(github.ref, 'refs/tags/v')
6157
uses: goreleaser/goreleaser-action@v6
@@ -65,3 +61,7 @@ jobs:
6561
args: release --release-notes=config/release/notes.md --rm-dist --skip-validate
6662
env:
6763
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
- name: Push chart to GHCR
65+
if: startsWith(github.ref, 'refs/tags/v')
66+
run: |
67+
helm push ./bin/chart/template-controller-*.tgz "oci://ghcr.io/${GITHUB_REPOSITORY_OWNER}/charts"

.goreleaser.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ release:
5959
draft: true
6060
prerelease: "true"
6161
extra_files:
62-
- glob: config/release/*.yaml
62+
- glob: bin/chart/template-controller-*.tgz
6363

6464
checksum:
6565
extra_files:
66-
- glob: config/release/*.yaml
66+
- glob: bin/chart/template-controller-*.tgz
6767
name_template: '{{ .ProjectName }}_v{{ .Version }}_checksums.txt'
6868

6969
source:

Makefile

-3
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,9 @@ helm-docs:
8888
cd $(HELM_DIR); \
8989
docker run --rm -v $(shell pwd)/$(HELM_DIR):/helm-docs -u $(shell id -u) jnorwood/helm-docs:v1.14.2
9090

91-
HELM_VERSION ?= $(shell helm show chart $(HELM_DIR) | grep 'version:' | sed 's/version: //g')
92-
9391
.PHONE: helm-package
9492
helm-package:
9593
helm package $(HELM_DIR) --destination $(OUTPUT_DIR)/chart
96-
mv $(OUTPUT_DIR)/chart/template-controller-$(HELM_VERSION).tgz $(OUTPUT_DIR)/chart/template-controller.tgz
9794

9895
##@ Build
9996

docs/install.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ kubectl apply -f "https://raw.githubusercontent.com/kluctl/template-controller/v
2020
A Helm Chart for the controller is available as well.
2121
To install the controller via Helm, run:
2222
```shell
23-
$ helm repo add kluctl https://kluctl.github.io/charts
24-
$ helm install template-controller -n template-controller --create-namespace kluctl/template-controller
23+
$ helm install template-controller -n template-controller --create-namespace oci://ghcr.io/kluctl/template-controller
2524
```
25+
26+
The Helm Chart is only distributed as an OCI package. The old Helm Repository found at https://github.com/kluctl/charts
27+
is not maintained anymore.

0 commit comments

Comments
 (0)