chore(ci): add publish.sh script

This commit is contained in:
WrenIX 2024-11-21 17:27:59 +01:00
parent c863fcaa6c
commit 9c09a6f19c
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5

View file

@ -12,14 +12,24 @@ ct lint # || exit 1
for p in * ; do
if \
[ ! -d $p ] || \
[ $p == template ] || \
[ $p == docs ] || \
[ ! -f $p/Chart.yaml ] \
; then
continue
fi
echo "${p}:";
lastVersion=$(oras repo tags "${HELM_REPO}/${p}" | sort --sort=version | tail -1)
echo "last pkg: ${lastVersion}"
v=$(dasel -f "${p}/Chart.yaml" -s version)
echo "version: ${v}";
if [ "${v}" == "${lastVersion}" ]; then
echo "nothing changed"
echo
continue
fi
echo
echo "update docs"
helm-docs -t ./README.md.gotmpl -t _docs.gotmpl -o README.md -g "${p}"
@ -27,6 +37,7 @@ for p in * ; do
echo "package and push helm-chart"
helm package "${p}"
helm push "${p}-${v}.tgz" "${HELM_REPO_URL}";
oras tag "${HELM_REPO}/${p}:${v}" "${v%\.[0-9]*}" "${v%\.[0-9]*\.[0-9]*}" "latest"
echo "push to git"
set -e