From 14ccf88a6172a158b0ccd44d83ce428f6ae550a9 Mon Sep 17 00:00:00 2001 From: Daniil Fedotov Date: Tue, 26 Nov 2024 16:32:19 -0500 Subject: [PATCH] fix: Update helm charts publishing Fix curl redirect when creating charts index Don't publish charts index to release artifacts Make charts publish a separate job in a workflow Signed-off-by: Daniil Fedotov --- .github/workflows/publish_docs.yaml | 3 --- .github/workflows/release.yaml | 30 +++++++++++++++++------------ .goreleaser.yml | 2 -- build/package_helm.sh | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/publish_docs.yaml b/.github/workflows/publish_docs.yaml index 50600c90ce..027e9b0527 100644 --- a/.github/workflows/publish_docs.yaml +++ b/.github/workflows/publish_docs.yaml @@ -45,9 +45,6 @@ jobs: echo "{\"version\":\"${RELEASE_TAG}\"}" > ./.vitepress/version.json pnpm docs:build working-directory: ./docs_new - - name: Download the helm index - run: | - curl https://github.com/kanisterio/kanister/releases/download/${RELEASE_TAG}/helm_index.yaml -f -L -o docs_new/.vitepress/dist/index.yaml - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 087c86ba59..9652494edd 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -84,14 +84,8 @@ jobs: with: ref: ${{ env.RELEASE_TAG }} fetch-depth: 0 - - name: build helm charts - run: | - export PACKAGE_FOLDER=helm_package - export HELM_RELEASE_REPO_URL=https://github.com/kanisterio/kanister/releases/download/${RELEASE_TAG} - export HELM_RELEASE_REPO_INDEX=https://charts.kanister.io/ - make package-helm VERSION=${RELEASE_TAG} - - name: Free Disk Space (Ubuntu) - uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 + # - name: Free Disk Space (Ubuntu) + # uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 - name: gorelease run: make gorelease env: @@ -118,13 +112,25 @@ jobs: GH_TOKEN: ${{ secrets.GH_TOKEN }} RELEASE_TAG: ${{ needs.run_if.outputs.release_tag }} steps: - - name: clone helm pages + - name: Checkout kanister repo + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + with: + ref: ${{ env.RELEASE_TAG }} + - name: Build helm charts + run: | + export PACKAGE_FOLDER=helm_package + export HELM_RELEASE_REPO_URL=https://github.com/kanisterio/kanister/releases/download/${RELEASE_TAG} + export HELM_RELEASE_REPO_INDEX=https://charts.kanister.io/index.yaml + make package-helm VERSION=${RELEASE_TAG} + - name: Upload chart archives to release + run: | + gh release upload ${RELEASE_TAG} helm_package/kanister-operator-* + - name: Clone charts pages repo run: | git clone https://infraq:${GH_TOKEN}@github.com/kanisterio/kanister-charts - - name: Download the helm index - working-directory: ./kanister-charts + - name: Copy helm index run: | - curl https://github.com/kanisterio/kanister/releases/download/${RELEASE_TAG}/helm_index.yaml -f -L -o index.yaml + cp ./helm_package/index.yaml ./kanister-charts/ - name: Commit changes working-directory: ./kanister-charts run: | diff --git a/.goreleaser.yml b/.goreleaser.yml index ef44b24200..8545818013 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -6,8 +6,6 @@ release: prerelease: auto extra_files: - glob: 'helm_package/kanister-operator-*.tgz' - - glob: 'helm_package/index.yaml' - name_template: helm_index.yaml builds: - id: kanctl binary: kanctl diff --git a/build/package_helm.sh b/build/package_helm.sh index 2cffe21a79..b133d763c9 100755 --- a/build/package_helm.sh +++ b/build/package_helm.sh @@ -38,7 +38,7 @@ main() { local repo_args="--url ${HELM_RELEASE_REPO_URL}" - if curl ${HELM_RELEASE_REPO_INDEX} -o ${PACKAGE_FOLDER}/cur_index.yaml + if curl -L ${HELM_RELEASE_REPO_INDEX} -o ${PACKAGE_FOLDER}/cur_index.yaml then repo_args="${repo_args} --merge ${PACKAGE_FOLDER}/cur_index.yaml" fi