chore(ci): improve publish.sh script

This commit is contained in:
WrenIX 2024-11-21 17:38:07 +01:00
parent f1c3954586
commit 330095207e
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5

View file

@ -12,6 +12,7 @@ ct lint # || exit 1
for p in * ; do for p in * ; do
if \ if \
[ ! -d $p ] || \ [ ! -d $p ] || \
[ $p == docs ] || \
[ ! -f $p/Chart.yaml ] \ [ ! -f $p/Chart.yaml ] \
; then ; then
continue continue
@ -54,16 +55,20 @@ for p in * ; do
echo "update docs" echo "update docs"
helm-docs -t ./README.md.gotmpl -t _docs.gotmpl -o README.md -g "${p}" helm-docs -t ./README.md.gotmpl -t _docs.gotmpl -o README.md -g "${p}"
rm "${p}/README.adoc" rm "${p}/README.adoc"
echo
echo "package and push helm-chart" echo "package and push helm-chart"
helm package "${p}" helm package "${p}"
helm push "${p}-${v}.tgz" "${HELM_REPO_URL}"; helm push "${p}-${v}.tgz" "${HELM_REPO_URL}";
oras tag "${HELM_REPO}/${p}:${v}" "${v%\.[0-9]*}" "${v%\.[0-9]*\.[0-9]*}" "latest"
echo
echo "update artifacthub.io" echo "update artifacthub.io"
set +e set +e
oras push "${HELM_REPO}/${p}:artifacthub.io" \ oras push "${HELM_REPO}/${p}:artifacthub.io" \
--config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \ --config /dev/null:application/vnd.cncf.artifacthub.config.v1+yaml \
"${p}/artifacthub-repo.yml":application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml "${p}/artifacthub-repo.yml":application/vnd.cncf.artifacthub.repository-metadata.layer.v1.yaml
echo
echo "push to git" echo "push to git"
set -e set -e