Skip to content

5.27.2

5.27.2 #18

Workflow file for this run

name: Release Charts
on:
release:
types: [ published ]
permissions:
id-token: write
contents: read
jobs:
release:
runs-on: ubuntu-latest
environment: master
env:
REPO_NAME: testops
CHART_NAME: testops
steps:
- name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Retrieve and verify version
run: |
CHART_VERSION=$(grep -m 1 '^version:' charts/testops/Chart.yaml | sed 's/version:[[:space:]]*//')
if [ "${{ github.event.release.tag_name }}" != "${CHART_VERSION}" ]; then
echo "Version mismatch: release tag ${{ github.event.release.tag_name }} does not match Chart.yaml version ${CHART_VERSION}"
exit 1
fi
echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
- uses: azure/setup-helm@v4
with:
version: v3.14.3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: eu-central-1
- name: Helm publish
run: |
echo "Packaging chart charts/${{ env.CHART_NAME }}"
helm dependency update charts/${{ env.CHART_NAME }}
helm package charts/${{ env.CHART_NAME }}
echo "Publishing Helm Chart"
aws s3 cp ${{ env.CHART_NAME }}-${CHART_VERSION}.tgz s3://${{ secrets.S3_BUCKET }}/artifactory/helm/${{ env.REPO_NAME }}/
echo "Updating Helm repository index"
mkdir -p /tmp/helm-repo
cd /tmp/helm-repo
aws s3 sync s3://${{ secrets.S3_BUCKET }}/artifactory/helm/ . --exclude "*" --include "*.tgz"
helm repo index . --url https://${{ vars.CHART_REGISTRY }}/artifactory/helm
aws s3 cp index.yaml s3://${{ secrets.S3_BUCKET }}/artifactory/helm/