Release Helm Charts #31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Helm Charts | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'charts/gardener-extension-provider-ironcore-metal/**' | |
| workflow_dispatch: | |
| jobs: | |
| helm-chart: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Helm | |
| uses: azure/setup-helm@v4 | |
| with: | |
| version: v3.16.2 | |
| - name: Determine chart version | |
| id: chart_version | |
| run: | | |
| if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then | |
| # Use SHA for main branch | |
| CHART_VERSION="0.0.0-$(echo ${{ github.sha }} | cut -c1-7)" | |
| elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| # Use tag version (strip 'v' prefix) | |
| CHART_VERSION="${GITHUB_REF#refs/tags/v}" | |
| else | |
| # Use PR SHA for dry run | |
| CHART_VERSION="0.0.0-$(echo ${{ github.sha }} | cut -c1-7)" | |
| fi | |
| echo "version=$CHART_VERSION" >> $GITHUB_OUTPUT | |
| - name: Log in to GitHub Container Registry | |
| run: | | |
| echo "${{ secrets.GITHUB_TOKEN }}" | helm registry login ghcr.io -u ${{ github.actor }} --password-stdin | |
| - name: Package provider Helm chart | |
| run: | | |
| helm package charts/gardener-extension-provider-ironcore-metal --version ${{ steps.chart_version.outputs.version }} | |
| - name: Push provider Helm chart to GHCR | |
| run: | | |
| helm push gardener-extension-provider-ironcore-metal-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts | |
| - name: Package admission runtime Helm chart | |
| run: | | |
| helm package charts/gardener-extension-admission-ironcore-metal/charts/runtime --version ${{ steps.chart_version.outputs.version }} | |
| - name: Push admission runtime Helm chart to GHCR | |
| run: | | |
| helm push gardener-extension-admission-ironcore-metal-runtime-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts | |
| - name: Package admission application Helm chart | |
| run: | | |
| helm package charts/gardener-extension-admission-ironcore-metal/charts/application --version ${{ steps.chart_version.outputs.version }} | |
| - name: Push admission application Helm chart to GHCR | |
| run: | | |
| helm push gardener-extension-admission-ironcore-metal-application-${{ steps.chart_version.outputs.version }}.tgz oci://ghcr.io/${{ github.repository_owner }}/charts |