From c2b4de66f0283195a3a0d8a6705c8c7f24de0525 Mon Sep 17 00:00:00 2001 From: daemon1024 Date: Fri, 2 Aug 2024 15:45:55 +0530 Subject: [PATCH] fix(helm): create release in charts repo stable release updates Signed-off-by: daemon1024 --- .../ci-latest-helm-chart-release.yaml | 46 ------------------- .github/workflows/ci-stable-release.yml | 13 +++++- 2 files changed, 11 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/ci-latest-helm-chart-release.yaml diff --git a/.github/workflows/ci-latest-helm-chart-release.yaml b/.github/workflows/ci-latest-helm-chart-release.yaml deleted file mode 100644 index a5e3a1d1a1..0000000000 --- a/.github/workflows/ci-latest-helm-chart-release.yaml +++ /dev/null @@ -1,46 +0,0 @@ -name: ci-latest-helm-chart-release - -on: - workflow_dispatch: - push: - branches: [main] - paths: - - "deployments/helm/**" - -# Declare default permissions as read only. -permissions: read-all - -jobs: - publish-chart: - name: Update Stable Helm Chart With Latest Changes - if: ${{ (github.repository == 'kubearmor/kubearmor') }} - runs-on: ubuntu-20.04 - permissions: - contents: write - steps: - - uses: actions/checkout@v3 - - - uses: azure/setup-helm@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Update Chart.yaml - run: | - STABLE_VERSION=`cat STABLE-RELEASE` - sed -i -e "s/appVersion:.*/appVersion: $STABLE_VERSION/g" deployments/helm/*/Chart.yaml - sed -i -e "s/version:.*/version: $STABLE_VERSION/g" deployments/helm/*/Chart.yaml - - - name: Publish Helm chart - uses: delusionaloptimist/helm-gh-pages@master - env: - # Access token which can push to a different repo in the same org - GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} - with: - charts_dir: deployments/helm - # repo where charts would be published - owner: kubearmor - repository: charts - branch: gh-pages - charts_url: https://kubearmor.github.io/charts - commit_username: "github-actions[bot]" - commit_email: "github-actions[bot]@users.noreply.github.com" diff --git a/.github/workflows/ci-stable-release.yml b/.github/workflows/ci-stable-release.yml index 5f764ef5fc..cb5d8e3dfb 100644 --- a/.github/workflows/ci-stable-release.yml +++ b/.github/workflows/ci-stable-release.yml @@ -13,7 +13,7 @@ jobs: push-stable-version: name: Create KubeArmor stable release if: github.repository == 'kubearmor/kubearmor' - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 60 steps: - uses: actions/checkout@v3 @@ -43,10 +43,19 @@ jobs: regctl image copy kubearmor/kubearmor-operator:$STABLE_VERSION kubearmor/kubearmor-operator:stable --digest-tags regctl image copy kubearmor/kubearmor-snitch:$STABLE_VERSION kubearmor/kubearmor-snitch:stable --digest-tags + - name: Publish Helm chart + env: + # Access token which can push to a different repo in the same org + GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }} + run: | + STABLE_VERSION=`cat STABLE-RELEASE` + gh release create --repo kubearmor/charts $STABLE_VERSION --generate-notes + + update-helm-chart: name: Update KubeArmor Helm chart version if: github.repository == 'kubearmor/kubearmor' - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 20 permissions: contents: write