@@ -13,19 +13,46 @@ jobs:
13
13
sudo snap install yq
14
14
- name : Parse Tag
15
15
run : echo ::set-env name=RELEASE_VERSION::${GITHUB_REF#refs/*/}
16
- - name : " Publish Helm Chart "
16
+ - name : " Publish Helm3 Charts "
17
17
env :
18
18
HELM_REGISTRY : https://charts.securecodebox.io
19
19
USERNAME : ${{ secrets.HELM_REGISTRY_USERNAME }}
20
20
PASSWORD : ${{ secrets.HELM_REGISTRY_PASSWORD }}
21
21
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
23
23
# https://github.com/koalaman/shellcheck/wiki/SC2044
24
24
find . -type f -name Chart.yaml -print0 | while IFS= read -r -d '' chart; do
25
25
(
26
26
dir="$(dirname "${chart}")"
27
27
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"
29
56
helm package --version $RELEASE_VERSION .
30
57
NAME=$(yq read - name < Chart.yaml)
31
58
curl --silent --show-error --user "${USERNAME}:${PASSWORD}" --data-binary "@${NAME}-${RELEASE_VERSION}.tgz" "${HELM_REGISTRY}/api/charts"
0 commit comments