Skip to content

Commit 91f9eed

Browse files
committed
feat: automated helm chart release
1 parent b457d35 commit 91f9eed

File tree

5 files changed

+32
-5
lines changed

5 files changed

+32
-5
lines changed

.cr-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
release-name-template: "v{{ .Version }}-chart"

.github/workflows/release.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,26 @@ jobs:
6565
version: '~> v2'
6666
args: release --clean
6767
env:
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
68+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69+
chart-releaser:
70+
runs-on: ubuntu-latest
71+
needs: release-please
72+
if: needs.release-please.outputs.releases_created == 'true'
73+
permissions:
74+
contents: write
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
with:
79+
fetch-depth: 0
80+
- name: Configure Git
81+
run: |
82+
git config user.name "$GITHUB_ACTOR"
83+
git config user.email "[email protected]"
84+
- name: Chart-releaser
85+
uses: helm/[email protected]
86+
with:
87+
config: .cr-config.yaml
88+
mark_as_latest: false
89+
env:
90+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,14 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
174174
$(ENVTEST): $(LOCALBIN)
175175
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
176176

177-
HELMIFY ?= $(LOCALBIN)/helmify -original-name charts/kube-startup-cpu-boost
177+
HELM_CHART_ROOT ?= charts/kube-startup-cpu-boost
178+
HELMIFY ?= $(LOCALBIN)/helmify -original-name ${HELM_CHART_ROOT}
178179

179180
.PHONY: helmify
180181
helmify: $(HELMIFY) ## Download helmify locally if necessary.
181182
$(HELMIFY): $(LOCALBIN)
182183
test -s $(LOCALBIN)/helmify || GOBIN=$(LOCALBIN) go install github.com/arttor/helmify/cmd/helmify@latest
183184

184185
helm: manifests kustomize helmify
185-
$(KUSTOMIZE) build config/default | $(HELMIFY)
186+
$(KUSTOMIZE) build . | $(HELMIFY)
187+
@sed -i 's/\(.\+tag: v[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1 #x-release-please-version/g' ${HELM_CHART_ROOT}/values.yaml

charts/kube-startup-cpu-boost/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ controllerManager:
1111
leaderElection: "true"
1212
image:
1313
repository: ghcr.io/google/kube-startup-cpu-boost
14-
tag: dev
14+
tag: v0.16.2 #x-release-please-version
1515
resources:
1616
limits:
1717
cpu: 500m

release-please-config.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
"bootstrap-sha": "c421a4f84641631d5ae3241323e4a5af63dc9731",
33
"extra-files": [
44
"README.md",
5-
"kustomization.yaml"
5+
"kustomization.yaml",
6+
"charts/kube-startup-cpu-boost/Chart.yaml",
7+
"charts/kube-startup-cpu-boost/values.yaml"
68
],
79
"packages": {
810
".": {

0 commit comments

Comments
 (0)