Skip to content

chore: backport 20260527 (#1317) #404

chore: backport 20260527 (#1317)

chore: backport 20260527 (#1317) #404

Workflow file for this run

name: Helm Chart Publisher
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
inputs:
tag:
description: "Release tag (e.g., v1.0.0)"
required: true
type: string
permissions:
contents: write
packages: write
env:
REGISTRY: ghcr.io
jobs:
export-registry:
uses: ./.github/workflows/setup-release.yml
with:
tag: ${{ inputs.tag || github.ref_name }}
publish-github-pages:
needs: export-registry
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: true
fetch-depth: 0
- name: Publish Helm chart to GitHub Pages
uses: stefanprodan/helm-gh-pages@0ad2bb377311d61ac04ad9eb6f252fb68e207260 # v1.7.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
charts_dir: charts
target_dir: charts
linting: on
publish-oci:
needs: export-registry
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Package and push Helm charts to GHCR via Makefile
run: |
set -euo pipefail
RELEASE_TAG="${{ needs.export-registry.outputs.tag }}"
CHART_VERSION="${{ needs.export-registry.outputs.version }}"
OCI_REGISTRY="${{ needs.export-registry.outputs.registry }}/charts"
make helm-push REGISTRY="${OCI_REGISTRY}" TAG="${RELEASE_TAG}" CHART_VERSION="${CHART_VERSION}"
- name: Verify chart appVersion matches release tag
run: |
set -euo pipefail
RELEASE_TAG="${{ needs.export-registry.outputs.tag }}"
CHART_VERSION="${{ needs.export-registry.outputs.version }}"
EXPECTED_APP_VERSION="${RELEASE_TAG}"
rm -rf .helm-verify
mkdir -p .helm-verify
for chart in hub-agent member-agent; do
helm pull "oci://${{ needs.export-registry.outputs.registry }}/charts/${chart}" --version "${CHART_VERSION}" --destination .helm-verify >/dev/null
packaged=".helm-verify/${chart}-${CHART_VERSION}.tgz"
actual_app_version=$(tar -xOf "${packaged}" "${chart}/Chart.yaml" | awk -F': ' '/^appVersion:/ {gsub(/"/, "", $2); print $2}')
if [[ "${actual_app_version}" != "${EXPECTED_APP_VERSION}" ]]; then
echo "ERROR: ${chart} appVersion (${actual_app_version}) does not match release tag (${EXPECTED_APP_VERSION})"
exit 1
fi
echo "✅ ${chart} appVersion=${actual_app_version} matches release tag=${EXPECTED_APP_VERSION}"
done
rm -rf .helm-verify