From 6db502929d1cfb45ab59eb0219700131ccaab508 Mon Sep 17 00:00:00 2001 From: Aymen Ben Tanfous Date: Wed, 10 Jul 2024 09:36:51 +0100 Subject: [PATCH] fix(helm-release): Added back Helm Chart release CI job Signed-off-by: Aymen Ben Tanfous --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8bcac95c..39f3069b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,6 +55,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: true + fetch-depth: 0 - name: Build run: | @@ -73,6 +74,34 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Install helm + uses: azure/setup-helm@v4 + + - name: Update helm chart version and publish it to main branch + run: | + git checkout main + sed -Ei \ + -e 's/^(version\:) .*/\1 '${{ env.VERSION }}'/g' \ + -e 's/^(appVersion\:) .*/\1 "'${{ env.VERSION }}'"/g' \ + charts/dragonfly-operator/Chart.yaml + + git config user.name "${{ github.actor }}" + git config user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com" + + git commit \ + -m 'chore(helm-chart): update to ${{ env.VERSION }}' \ + charts/dragonfly-operator/Chart.yaml + + git push + - name: Push Helm chart as OCI to Github + run: | + echo "${{ secrets.GITHUB_TOKEN }}" | \ + helm registry login -u ${{ github.actor }} --password-stdin ghcr.io + + helm package charts/dragonfly-operator + + helm push dragonfly-operator-${{ env.VERSION }}.tgz oci://ghcr.io/dragonflydb/dragonfly-operator/helm + - name: Build and Publish image into GHCR uses: docker/build-push-action@v5 with: @@ -100,4 +129,5 @@ jobs: Release ${{ github.ref_name }} Docker image: ghcr.io/dragonflydb/operator:${{ github.ref_name }} + Helm chart: oci://ghcr.io/dragonflydb/dragonfly-operator/helm draft: true