Skip to content

sync: release: bump helm chart to 4.2.7 #46

sync: release: bump helm chart to 4.2.7

sync: release: bump helm chart to 4.2.7 #46

Workflow file for this run

name: Publish Helm Chart
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
# Triggered by version tag push from sync-helm-chart.yaml.
# Packages the chart with root README and pushes to GHCR.
publish-release:
if: startsWith(github.ref, 'refs/tags/v')
name: Publish release chart
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: azure/setup-helm@v4
with:
version: 'v3.18.4'
- name: Copy README into chart directory
run: cp README.md charts/platforma/README.md
- name: Extract chart version
id: version
run: |
VERSION=$(grep '^version:' charts/platforma/Chart.yaml | awk '{print $2}')
echo "version=${VERSION}" >> "${GITHUB_OUTPUT}"
- name: Package chart
run: helm package charts/platforma -d packages/
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push to GHCR
run: helm push packages/platforma-${{ steps.version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository }}
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::511903394050:role/prod-platforma-helm-github-oidc-euce1
aws-region: eu-central-1
- name: Upload CFN template to S3
env:
CHART_VERSION: ${{ steps.version.outputs.version }}
run: |
set -euo pipefail
CFN_FILE=./infrastructure/aws/cloudformation/cloudformation-eks-1-35.yaml
# Fail loudly if the template is missing (e.g. moved by an upstream sync)
# instead of silently leaving the public S3 object stale.
if [ ! -f "${CFN_FILE}" ]; then
echo "::error::CFN template not found at ${CFN_FILE}"
exit 1
fi
# Guard: the template's Platforma version must match the chart version
# being released, so we never publish a mismatched template.
TPL_VERSION=$(sed -nE '/^[[:space:]]*Platforma:/{n;s/.*Version:[[:space:]]*"([^"]+)".*/\1/p}' "${CFN_FILE}")
echo "template Platforma version: ${TPL_VERSION}, chart version: ${CHART_VERSION}"
if [ "${TPL_VERSION}" != "${CHART_VERSION}" ]; then
echo "::error::CFN template version (${TPL_VERSION}) != chart version (${CHART_VERSION})"
exit 1
fi
aws s3 cp "${CFN_FILE}" s3://platforma-cloudformation/cloudformation-eks-1-35.yaml --content-type text/yaml