Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions .github/workflows/release-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,20 @@ jobs:
with:
version: '3.19.2'

- name: Extract versions
- name: Determine chart version
id: versions
run: |
CHART_VERSION=$(make helm-print-chart-version)
BASE_VERSION=$(make helm-print-chart-version)

# Use development version for workflow_dispatch, stable version for tags
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
GIT_SHORT_SHA=$(git rev-parse --short HEAD)
CHART_VERSION="${BASE_VERSION}-dev.${GIT_SHORT_SHA}"
echo "::notice::Creating development release: ${CHART_VERSION}"
else
CHART_VERSION="${BASE_VERSION}"
echo "::notice::Creating stable release: ${CHART_VERSION}"
fi
echo "chart_version=$CHART_VERSION" >> $GITHUB_OUTPUT
echo "Chart version: $CHART_VERSION"

Expand All @@ -59,15 +69,25 @@ jobs:
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ steps.versions.outputs.helm_registry }} -u ${{ github.actor }} --password-stdin

- name: Package Helm chart and push chart to OCI registry
- name: Package and push Helm chart
env:
HELM_CHART_VERSION: ${{ steps.versions.outputs.chart_version }}
run: make helm-push

- name: Verify chart installation
env:
HELM_CHART_VERSION: ${{ steps.versions.outputs.chart_version }}
run: make helm-verify

- name: Generate release summary
run: |
echo "## Helm Chart Release Summary" >> $GITHUB_STEP_SUMMARY
if [[ "${{ steps.versions.outputs.chart_version }}" == *"-dev."* ]]; then
RELEASE_TYPE="Development"
else
RELEASE_TYPE="Stable"
fi

echo "## Helm Chart Release Summary ($RELEASE_TYPE)" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Chart Name:** ${{ steps.versions.outputs.chart_name }}" >> $GITHUB_STEP_SUMMARY
echo "- **Chart Version:** ${{ steps.versions.outputs.chart_version }}" >> $GITHUB_STEP_SUMMARY
Expand Down
12 changes: 8 additions & 4 deletions build/helm.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
##@ Helm Chart build targets

HELM_CHART_DIR = ./charts/kubernetes-mcp-server
HELM_CHART_VERSION = $(shell grep '^version:' $(HELM_CHART_DIR)/Chart.yaml | awk '{print $$2}')
HELM_CHART_VERSION_BASE = $(shell grep '^version:' $(HELM_CHART_DIR)/Chart.yaml | awk '{print $$2}')
HELM_CHART_VERSION ?= $(HELM_CHART_VERSION_BASE)
HELM_PACKAGE_DIR = ./_output/helm-packages
HELM_REGISTRY ?= ghcr.io
HELM_REGISTRY_ORG ?= containers
Expand Down Expand Up @@ -38,14 +39,17 @@ helm-validate: kubeconform ## Validate Helm chart manifests with kubeconform
helm template test-release $(HELM_CHART_DIR) --set ingress.host=localhost | $(KUBECONFORM) -strict -summary -ignore-missing-schemas

.PHONY: helm-package
helm-package: helm-lint helm-template ## Package the Helm chart
helm-package: helm-lint helm-template ## Package the Helm chart (supports HELM_CHART_VERSION override)
@mkdir -p $(HELM_PACKAGE_DIR)
@echo "Updating appVersion to $(GIT_TAG_VERSION)..."
@sed -i.bak "s/appVersion: .*/appVersion: \"$(GIT_TAG_VERSION)\"/" $(HELM_CHART_DIR)/Chart.yaml
@echo "Updating Chart.yaml for packaging..."
@sed -i.bak -e "s/version: .*/version: $(HELM_CHART_VERSION)/" \
-e "s/appVersion: .*/appVersion: \"$(GIT_TAG_VERSION)\"/" \
$(HELM_CHART_DIR)/Chart.yaml
@echo "Updated Chart.yaml:"
@cat $(HELM_CHART_DIR)/Chart.yaml
helm package $(HELM_CHART_DIR) --destination $(HELM_PACKAGE_DIR)
@mv $(HELM_CHART_DIR)/Chart.yaml.bak $(HELM_CHART_DIR)/Chart.yaml
@echo "Chart packaged as version $(HELM_CHART_VERSION)"

.PHONY: helm-push
helm-push: helm-package ## Push Helm chart to OCI registry (assumes helm registry login has been performed)
Expand Down