chore(ci): improve publish.sh script

This commit is contained in:
WrenIX 2024-11-26 11:59:25 +01:00
parent b53cc652e1
commit e464c02875
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5

View file

@ -19,7 +19,7 @@ for p in * ; do
continue continue
fi fi
echo "${p}:"; echo "=== ${p} ===";
lastVersion=$(oras repo tags "${HELM_REPO}/${p}" | sort --sort=version | tail -1) lastVersion=$(oras repo tags "${HELM_REPO}/${p}" | sort --sort=version | tail -1)
echo "last pkg: ${lastVersion}" echo "last pkg: ${lastVersion}"
v=$(dasel -f "${p}/Chart.yaml" -s version) v=$(dasel -f "${p}/Chart.yaml" -s version)
@ -40,11 +40,9 @@ for p in * ; do
oras tag "${HELM_REPO}/${p}:${v}" "${v%\.[0-9]*}" "${v%\.[0-9]*\.[0-9]*}" "latest" oras tag "${HELM_REPO}/${p}:${v}" "${v%\.[0-9]*}" "${v%\.[0-9]*\.[0-9]*}" "latest"
echo "push to git" echo "push to git"
set -e
git add "${p}/" git add "${p}/"
git commit -m "${COMMIT_SCOPE}(${p}): ${COMMIT_MESSAGE}" git commit -m "${COMMIT_SCOPE}(${p}): ${COMMIT_MESSAGE}"
git push origin main; git push origin main;
set +e
echo echo
done done