Skip to content

Commit

Permalink
switch back to using chart releaser
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed Sep 19, 2024
1 parent b6be786 commit 902be8c
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions .github/workflows/release-helm-chart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,44 +64,44 @@ jobs:
uses: azure/setup-helm@v4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
CR_SKIP_EXISTING: "true"
CR_RELEASE_NAME_TEMPLATE: "kubeai-helm-chart-{{ .Name }}-{{ .Version }}"
# The chart-releaser action is not able to publish all the the chart on tag push.
# It only published the kubeai chart. Below is the original code used.
#- name: Run chart-releaser
# uses: helm/[email protected]
# env:
# CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
# CR_SKIP_EXISTING: "true"
# CR_RELEASE_NAME_TEMPLATE: "kubeai-helm-chart-{{ .Version }}"
# Workaround for always publishing all charts on tag push.
# The workaround may not be needed if we set
# CR_RELEASE_NAME_TEMPLATE: "kubeai-helm-chart-{{ .Name }}-{{ .Version }}"
# Source: https://github.com/helm/chart-releaser-action/issues/8#issuecomment-962501009
- name: Package and upload helm chart
run: |
set -xe
# donwload helm chart releaser
VERSION=v1.6.1
curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/${VERSION}/chart-releaser_1.6.1_linux_amd64.tar.gz"
tar -xzf cr.tar.gz
rm -f cr.tar.gz
owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
# package charts
./cr package charts/kubeai
./cr package charts/models
# upload chart to github relases
./cr upload \
--owner "$owner" \
--git-repo "$repo" \
--token "${{ secrets.GITHUB_TOKEN }}" \
--skip-existing \
--release-name-template "kubeai-helm-chart-{{ .Name }}-{{ .Version }}" \
# update index and push to github pages
./cr index \
--owner "$owner" \
--git-repo "$repo" \
--token "${{ secrets.GITHUB_TOKEN }}" \
--release-name-template "kubeai-helm-chart-{{ .Name }}-{{ .Version }}" \
--index-path ./index.yaml \
--charts-repo https://$owner.github.io/$repo \
--push
# - name: Package and upload helm chart
# run: |
# set -xe
# # donwload helm chart releaser
# VERSION=v1.6.1
# curl -sSLo cr.tar.gz "https://github.com/helm/chart-releaser/releases/download/${VERSION}/chart-releaser_1.6.1_linux_amd64.tar.gz"
# tar -xzf cr.tar.gz
# rm -f cr.tar.gz
# owner=$(cut -d '/' -f 1 <<< "$GITHUB_REPOSITORY")
# repo=$(cut -d '/' -f 2 <<< "$GITHUB_REPOSITORY")
# # package charts
# ./cr package charts/kubeai
# ./cr package charts/models
# # upload chart to github relases
# ./cr upload \
# --owner "$owner" \
# --git-repo "$repo" \
# --token "${{ secrets.GITHUB_TOKEN }}" \
# --skip-existing \
# --release-name-template "kubeai-helm-chart-{{ .Name }}-{{ .Version }}" \
# # update index and push to github pages
# ./cr index \
# --owner "$owner" \
# --git-repo "$repo" \
# --token "${{ secrets.GITHUB_TOKEN }}" \
# --release-name-template "kubeai-helm-chart-{{ .Name }}-{{ .Version }}" \
# --index-path ./index.yaml \
# --charts-repo https://$owner.github.io/$repo \
# --push

0 comments on commit 902be8c

Please sign in to comment.