Skip to content

Commit

Permalink
Release pipeline for helm chart
Browse files Browse the repository at this point in the history
Signed-off-by: Jirka Kremser <[email protected]>
  • Loading branch information
jkremser committed Oct 16, 2024
1 parent 4789fb0 commit dd0ecfd
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 6 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/release-chart.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,41 @@
name: Helm Publish

on:
release:
types:
- published
push:
branches:
- 'main'
paths:
- 'helmchart/otel-add-on/Chart.yaml'
permissions:
contents: read

jobs:
check-if-new-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: yq
uses: mikefarah/[email protected]
- name: Compare versions
run: |
latest_version=$(make version)
maybe_old_version=$(yq '.version' helmchart/otel-add-on/Chart.yaml)
echo "latest_version: ${latest_version}"
echo "maybe_old_version: ${maybe_old_version}"
if [ "${latest_version}" != "${maybe_old_version}" ]; then
echo "modifying Chart.yaml.."
yq -i ".version=${latest_version} | .appVersion=${latest_version}" helmchart/otel-add-on/Chart.yaml
git add helmchart/otel-add-on/Chart.yaml
git commit -s -m "Updating Chart.yaml: ${maybe_old_version} -> ${latest_version}"
git push
fi
test:
runs-on: ubuntu-latest
needs: [check-if-new-version]
steps:
- uses: actions/checkout@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ help: ## Show this help.

.PHONY: version
version:
@echo $(VERSION)
@echo $(LATEST_TAG)

ifndef NO_COLOR
YELLOW=\033[0;33m
Expand Down
4 changes: 2 additions & 2 deletions helmchart/otel-add-on/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: otel-add-on
description: A Helm chart for otel-add-on
type: application
version: 0.0.1
appVersion: "0.0.1"
version: v0.0.0-1
appVersion: v0.0.0-1
kubeVersion: ">= 1.19.0-0"
icon: https://raw.githubusercontent.com/kedacore/keda/main/images/keda-logo-500x500-white.png

Expand Down

0 comments on commit dd0ecfd

Please sign in to comment.