1515 - name : " Install yq"
1616 run : |
1717 sudo snap install yq
18- - name : " Publish Helm3 Charts"
18+ - name : " Publish Helm Charts"
1919 env :
2020 HELM_REGISTRY : https://charts.securecodebox.io
2121 USERNAME : ${{ secrets.HELM_REGISTRY_USERNAME }}
@@ -24,46 +24,13 @@ jobs:
2424 RELEASE_VERSION="${GITHUB_REF#refs/*/}"
2525 # Remove leading 'v' from git tag to create valid semver
2626 RELEASE_VERSION="${RELEASE_VERSION//v}"
27- # Publish all helm3 charts in all folders containing a `Chart.yaml` file
27+ # Publish all helm charts in all folders containing a `Chart.yaml` file
2828 # https://github.com/koalaman/shellcheck/wiki/SC2044
2929 find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
3030 (
3131 dir="$(dirname "${chart}")"
3232 cd "${dir}" || exit
33- echo "Processing Helm3 Chart in $dir"
34- helm package --version $RELEASE_VERSION .
35- NAME=$(yq eval '.name' - < Chart.yaml)
36- curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
37- )
38- done
39- - name : " Publish Helm2 Charts"
40- env :
41- HELM_REGISTRY : https://charts-helm2.securecodebox.io
42- USERNAME : ${{ secrets.HELM_REGISTRY_USERNAME }}
43- PASSWORD : ${{ secrets.HELM_REGISTRY_PASSWORD }}
44- run : |
45- RELEASE_VERSION="${GITHUB_REF#refs/*/}"
46- # Remove leading 'v' from git tag to create valid semver
47- RELEASE_VERSION="${RELEASE_VERSION//v}"
48- # Publish all helm2 charts in all folders containing a `helm2.Chart.yaml` file
49- # https://github.com/koalaman/shellcheck/wiki/SC2044
50- find . -type f -name helm2.Chart.yaml -print0 | while IFS= read -r -d '' chart; do
51- (
52- dir="$(dirname "${chart}")"
53- cd "${dir}" || exit
54- mv Chart.yaml helm3.Chart.yaml
55- mv helm2.Chart.yaml Chart.yaml
56- if [ "$(basename "$PWD")" = "operator" ]
57- then
58- echo "Moving CRDS to templates folder, as helm2 doesn't have native crds support."
59- mv crds templates/crds
60- fi
61- echo "Restoring Helm2 Chart and replace Helm3 Chart temporary"
62- [ ! -f helm2.requirements.lock ] || mv helm2.requirements.lock requirements.lock
63- [ ! -f helm2.requirements.yaml ] || mv helm2.requirements.yaml requirements.yaml
64- # Removing packaged Helm3 chart version build in the previous step
65- rm *.tgz
66- echo "Processing Helm2 Chart in $dir"
33+ echo "Processing Helm Chart in $dir"
6734 helm package --version $RELEASE_VERSION .
6835 NAME=$(yq eval '.name' - < Chart.yaml)
6936 curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
0 commit comments