Skip to content

Commit 4fcd19d

Browse files
authored
release: publish escalation chart on tag builds (#576)
1 parent a26ee1d commit 4fcd19d

File tree

4 files changed

+105
-4
lines changed

4 files changed

+105
-4
lines changed

.github/workflows/release.yml

Lines changed: 78 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ env:
1919

2020
jobs:
2121
# ---------------------------------------------------------------------------
22-
# Build release manifests and bgctl CLI binaries
22+
# Build release manifests, Helm chart package, and bgctl CLI binaries
2323
# ---------------------------------------------------------------------------
2424
prepare:
2525
permissions:
@@ -32,6 +32,10 @@ jobs:
3232
with:
3333
go-version-file: go.mod
3434
cache: true
35+
- name: Set up Helm
36+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
37+
with:
38+
version: v4.0.4
3539
- name: Generate manifests
3640
run: |
3741
make manifests
@@ -68,6 +72,23 @@ jobs:
6872
manifests-base.yaml
6973
manifests-debug.yaml
7074
manifests-crds.yaml
75+
- name: Package escalation Helm chart
76+
run: |
77+
set -euo pipefail
78+
79+
# Keep chart version from Chart.yaml; stamp appVersion with the release tag.
80+
mkdir -p chart-dist
81+
helm package charts/escalation-config \
82+
--destination chart-dist \
83+
--app-version "${{ github.ref_name }}"
84+
85+
echo "Packaged chart artifacts:"
86+
ls -la chart-dist
87+
- name: Upload chart artifact
88+
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
89+
with:
90+
name: release-chart
91+
path: chart-dist/escalation-config-*.tgz
7192
- name: Build bgctl release assets
7293
run: |
7394
set -e
@@ -431,13 +452,62 @@ jobs:
431452
echo "Warning: Artifact path not confirmed after retries (HTTP ${HTTP_STATUS_AFTER}). It might be a permission issue or Artifactory indexing delay."
432453
fi
433454
455+
# ---------------------------------------------------------------------------
456+
# Publish escalation-config Helm chart to GHCR OCI
457+
# ---------------------------------------------------------------------------
458+
publish-chart:
459+
needs: [prepare]
460+
permissions:
461+
contents: read
462+
packages: write
463+
runs-on: ubuntu-latest
464+
steps:
465+
- name: Download chart artifact
466+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
467+
with:
468+
name: release-chart
469+
path: chart-dist
470+
- name: Set up Helm
471+
uses: azure/setup-helm@1a275c3b69536ee54be43f2070a358922e12c8d4 # v4.3.1
472+
with:
473+
version: v4.0.4
474+
- name: Login to GHCR for Helm OCI
475+
run: |
476+
echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ${{ env.REGISTRY }} \
477+
--username "${{ github.actor }}" \
478+
--password-stdin
479+
- name: Publish escalation-config chart
480+
env:
481+
CHART_REPO: oci://ghcr.io/${{ github.repository }}/charts
482+
run: |
483+
set -euo pipefail
484+
485+
CHART_PACKAGE="$(ls chart-dist/escalation-config-*.tgz | head -n1)"
486+
CHART_VERSION="$(helm show chart "${CHART_PACKAGE}" | awk '/^version:/ {print $2}')"
487+
488+
if [ -z "${CHART_VERSION}" ]; then
489+
echo "Failed to determine chart version from ${CHART_PACKAGE}" >&2
490+
exit 1
491+
fi
492+
493+
echo "Preparing to publish escalation-config:${CHART_VERSION} to ${CHART_REPO}"
494+
495+
# Idempotent behavior for reruns: skip if this chart version already exists.
496+
if helm show chart "${CHART_REPO}/escalation-config" --version "${CHART_VERSION}" >/dev/null 2>&1; then
497+
echo "Chart escalation-config:${CHART_VERSION} already present in GHCR; skipping push."
498+
exit 0
499+
fi
500+
501+
helm push "${CHART_PACKAGE}" "${CHART_REPO}"
502+
echo "Published ${CHART_PACKAGE} to ${CHART_REPO}"
503+
434504
# ---------------------------------------------------------------------------
435505
# Create GitHub Release with manifests, bgctl binaries, and SBOM
436506
# ---------------------------------------------------------------------------
437507
release:
438508
# NOTE: Does not depend on `artifactory` intentionally — Artifactory is a
439509
# best-effort mirror and should not block GitHub Release creation.
440-
needs: [prepare, assemble]
510+
needs: [prepare, assemble, publish-chart]
441511
permissions:
442512
contents: write
443513
packages: read
@@ -453,6 +523,11 @@ jobs:
453523
with:
454524
name: bgctl-dist
455525
path: dist
526+
- name: Download chart artifact
527+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
528+
with:
529+
name: release-chart
530+
path: chart-dist
456531
- name: Create GitHub Release
457532
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
458533
with:
@@ -461,6 +536,7 @@ jobs:
461536
manifests-base.yaml
462537
manifests-debug.yaml
463538
manifests-crds.yaml
539+
chart-dist/escalation-config-*.tgz
464540
dist/bgctl_*.tar.gz
465541
dist/bgctl_*.zip
466542
dist/bgctl_*.sha256

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Changed
1111

1212
- **Frontend: upgrade Vite 7 → 8 and @vitejs/plugin-legacy 7 → 8** (PR #562): Major version bumps — Vite 8 replaces Rollup with Rolldown and removes esbuild in favor of Oxc. `@vitejs/plugin-vue` patch bumped to 6.0.5. No breaking changes to the frontend build configuration.
13+
- **Release workflow: publish escalation Helm chart**: Tag-based releases now package `charts/escalation-config`, publish it to GHCR Helm OCI (`oci://ghcr.io/telekom/k8s-breakglass/charts/escalation-config`), and attach the chart `.tgz` to the GitHub Release assets.
1314

1415
- **Webhook SAR metrics: removed high-cardinality `group` label** ([#527](https://github.com/telekom/k8s-breakglass/issues/527)): Removed unbounded `group` label from `breakglass_webhook_session_sar_{allowed,denied,errors}_total` metrics to prevent time-series explosion in Prometheus
1516
- **JWT and JWKS metrics label renamed from `issuer` to `identity_provider`** ([#472](https://github.com/telekom/k8s-breakglass/issues/472)): Prometheus metrics `breakglass_jwt_validation_*` and `breakglass_jwks_cache_{hits,misses}_total` now use the `identity_provider` label (resolved IDP name) instead of `issuer` (raw URL) to prevent unbounded cardinality from attacker-controlled issuer claims. Dashboards/alerts referencing the old `issuer` label on these metrics must be updated.

charts/escalation-config/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,18 @@ helm install my-escalation ./charts/escalation-config \
3434
--set cluster.tenant=production
3535
```
3636

37+
### Installation from GHCR Helm OCI (release artifacts)
38+
39+
```bash
40+
helm install my-escalation \
41+
oci://ghcr.io/telekom/k8s-breakglass/charts/escalation-config \
42+
--version <chart-version> \
43+
-f values.yaml
44+
```
45+
46+
`<chart-version>` is the chart `version` from `charts/escalation-config/Chart.yaml`.
47+
It is versioned independently from the container image tag.
48+
3749
## Configuration
3850

3951
### Cluster Configuration

docs/release-process.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,23 @@ This document defines the release requirements for k8s-breakglass. It is intende
3333
- An SPDX-JSON SBOM attestation is attached to each signed image via `cosign attest`.
3434
- Cosign signatures and attestations are mirrored to Artifactory on a best-effort basis via `cosign copy`.
3535

36+
7. **Helm chart publication**
37+
- `charts/escalation-config` is packaged during release preparation.
38+
- The packaged chart is pushed to GHCR as a Helm OCI artifact at `oci://ghcr.io/telekom/k8s-breakglass/charts/escalation-config`.
39+
- The chart `.tgz` is attached to the GitHub Release assets.
40+
3641
## Multi-Architecture Builds
3742

3843
Release images are built as multi-arch manifests supporting both `linux/amd64` and `linux/arm64` platforms. Each architecture is built natively on a dedicated runner (no QEMU emulation), then assembled into a single multi-arch manifest list.
3944

4045
**Build pipeline:**
4146

42-
1. **Prepare** — generates Kustomize manifests, cross-compiles `bgctl` binaries for all OS/arch combinations, and uploads them as artifacts.
47+
1. **Prepare** — generates Kustomize manifests, packages `charts/escalation-config`, cross-compiles `bgctl` binaries for all OS/arch combinations, and uploads them as artifacts.
4348
2. **Build** (matrix: `amd64`, `arm64`) — builds and pushes a single-platform image by digest on a native runner for each architecture.
4449
3. **Assemble** — downloads all per-arch digests and creates a unified multi-arch manifest tagged with the release version (and `latest` for tag pushes). Generates SLSA provenance attestation, signs the image with keyless Cosign, and attaches an SBOM attestation.
4550
4. **Artifactory** — mirrors the multi-arch image and cosign artifacts (signatures + attestations) to the internal Artifactory OCI registry (best-effort).
46-
5. **Release** — creates a GitHub Release with manifests, `bgctl` binaries, checksums, and SBOM (SPDX-JSON format via Syft).
51+
5. **Publish chart** — pushes `escalation-config` chart to GHCR Helm OCI (`oci://ghcr.io/telekom/k8s-breakglass/charts`).
52+
6. **Release** — creates a GitHub Release with manifests, Helm chart package, `bgctl` binaries, checksums, and SBOM (SPDX-JSON format via Syft).
4753

4854
> **Note:** Buildx layer caching (`cache-from`/`cache-to`) is intentionally omitted in
4955
> release builds to ensure clean, reproducible images without layer reuse from prior
@@ -54,6 +60,7 @@ Release images are built as multi-arch manifests supporting both `linux/amd64` a
5460
- Verify CI success on the release commit.
5561
- Ensure the changelog is up to date.
5662
- Generate artifacts via the release workflow.
63+
- Verify chart publication in GHCR (`oci://ghcr.io/telekom/k8s-breakglass/charts/escalation-config`).
5764
- Publish checksums and update release notes.
5865
- Verify provenance attestation was pushed to the registry.
5966
- Verify SBOM is attached to the GitHub Release.
@@ -67,6 +74,11 @@ Consumers should be able to:
6774
- Verify provenance attestation via `gh attestation verify` or the GitHub attestation API.
6875
- Verify SBOM contents match the release image.
6976
- Verify Cosign signature: `cosign verify ghcr.io/telekom/k8s-breakglass@<digest> --certificate-identity-regexp='https://github.com/telekom/k8s-breakglass/' --certificate-oidc-issuer='https://token.actions.githubusercontent.com'`
77+
- Verify Helm chart availability:
78+
```bash
79+
helm show chart oci://ghcr.io/telekom/k8s-breakglass/charts/escalation-config \
80+
--version <chart-version>
81+
```
7082
- Verify SBOM attestation:
7183
```bash
7284
cosign verify-attestation ghcr.io/telekom/k8s-breakglass@<digest> \

0 commit comments

Comments
 (0)