fix(ci): fail hard when registry upload returns non-2xx

curl -sf was silencing upload errors: r105 was 'Published' six times
in a row but never landed in the registry. Capture the HTTP status
and abort on non-2xx so the run goes red and the response body shows
up in the log.
This commit is contained in:
nevaforget 2026-04-20 12:47:26 +02:00
parent e49d4e48b1
commit 41a22d6281

View File

@ -84,13 +84,22 @@ jobs:
-H "Authorization: token ${{ secrets.PKG_REGISTRY_TOKEN }}" \
"https://gitea.moonarch.de/api/packages/nevaforget/arch/moonarch/${PKG_NAME}/${FULL_VER}/${PKG_ARCH}" || true
# Upload new version
curl -sf \
# Upload new version. Capture HTTP status — curl -sf alone
# hides the response, and a silent failure lets the run green
# while the registry stays stale.
HTTP_CODE=$(curl -s -w '%{http_code}' -o /tmp/upload.log \
-H "Authorization: token ${{ secrets.PKG_REGISTRY_TOKEN }}" \
--upload-file "$PKG_FILE" \
"https://gitea.moonarch.de/api/packages/nevaforget/arch/moonarch"
"https://gitea.moonarch.de/api/packages/nevaforget/arch/moonarch")
if [[ ! "$HTTP_CODE" =~ ^2 ]]; then
echo "ERROR: Upload failed with HTTP $HTTP_CODE for $PKG_FILE"
echo "--- server response ---"
cat /tmp/upload.log
echo "-----------------------"
exit 1
fi
echo "==> Published $PKG_NAME $FULL_VER"
echo "==> Published $PKG_NAME $FULL_VER (HTTP $HTTP_CODE)"
done
cd ..
done