Build twice to avoid having dirty working tree

Makes debugging build issues much more fun
This commit is contained in:
ChillerDragon 2023-04-06 17:56:25 +02:00
parent 146f2214e0
commit 78ea668487

View file

@ -186,6 +186,14 @@ then
exit 1 exit 1
fi fi
# Do not update setup.cfg
# if the build fails anyways
if ! python -m build
then
echo "Error: build failed"
exit 1
fi
echo "[*] updating version in setup.cfg ..." echo "[*] updating version in setup.cfg ..."
# can safely be ran multiple times # can safely be ran multiple times
sed -i "s/^version =.*/version = ${tag_name:1}/" setup.cfg sed -i "s/^version =.*/version = ${tag_name:1}/" setup.cfg
@ -193,6 +201,7 @@ sed -i "s/^version =.*/version = ${tag_name:1}/" setup.cfg
echo "[*] wiping old dist ..." echo "[*] wiping old dist ..."
[[ -d dist ]] && rm -rf dist [[ -d dist ]] && rm -rf dist
# Try build again after setup.cfg update
if ! python -m build if ! python -m build
then then
echo "Error: build failed" echo "Error: build failed"