@@ -13,19 +13,46 @@ jobs:
1313 sudo snap install yq
1414 - name : Parse Tag
1515 run : echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
16- - name : " Publish Helm Chart "
16+ - name : " Publish Helm3 Charts "
1717 env :
1818 HELM_REGISTRY : https://charts.securecodebox.io
1919 USERNAME : ${{ secrets.HELM_REGISTRY_USERNAME }}
2020 PASSWORD : ${{ secrets.HELM_REGISTRY_PASSWORD }}
2121 run : |
22- # Publish charts in all folders containing a `Chart.yaml` file
22+ # Publish all helm3 charts in all folders containing a `Chart.yaml` file
2323 # https://github.com/koalaman/shellcheck/wiki/SC2044
2424 find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
2525 (
2626 dir="$(dirname "${chart}")"
2727 cd "${dir}" || exit
28- echo "Processing Chart in $dir"
28+ echo "Processing Helm3 Chart in $dir"
29+ helm package --version $RELEASE_VERSION .
30+ NAME=$(yq read - name < Chart.yaml)
31+ curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
32+ )
33+ done
34+ - name : " Publish Helm2 Charts"
35+ env :
36+ HELM_REGISTRY : https://charts-helm2.securecodebox.io
37+ USERNAME : ${{ secrets.HELM_REGISTRY_USERNAME }}
38+ PASSWORD : ${{ secrets.HELM_REGISTRY_PASSWORD }}
39+ run : |
40+ # Publish all helm2 charts in all folders containing a `helm2.Chart.yaml` file
41+ # https://github.com/koalaman/shellcheck/wiki/SC2044
42+ find . -type f -name helm2.Chart.yaml -print0 | while IFS= read -r -d '' chart; do
43+ (
44+ dir="$(dirname "${chart}")"
45+ cd "${dir}" || exit
46+ mv Chart.yaml helm3.Chart.yaml
47+ mv helm2.Chart.yaml Chart.yaml
48+ if [ ${dir} = "operator" ]
49+ then
50+ cp -R crds templates/crds
51+ fi
52+ echo "Restoring Helm2 Chart and replace Helm3 Chart temporary"
53+ [ ! -f helm2.requirements.lock ] || mv helm2.requirements.lock requirements.lock
54+ [ ! -f helm2.requirements.yaml ] || mv helm2.requirements.yaml requirements.yaml
55+ echo "Processing Helm2 Chart in $dir"
2956 helm package --version $RELEASE_VERSION .
3057 NAME=$(yq read - name < Chart.yaml)
3158 curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
0 commit comments