fix: improve package publish debugging and hardcode API URL
Some checks failed
release-nightly / publish-nightly (push) Failing after 51s
release / goreleaser (push) Successful in 1m17s
release / publish-packages (push) Failing after 33s

- Hardcode git.lethalbits.com instead of gitea.server_url variable
- Replace brace expansion with separate glob patterns for POSIX compat
- Add HTTP status code checking with response body on failure
- Add debug output for URL, actor, and file listing
This commit is contained in:
Andrew Miller
2026-03-05 13:20:15 -05:00
parent d3c4e271ef
commit 1b806fc393
2 changed files with 33 additions and 8 deletions

View File

@@ -43,12 +43,25 @@ jobs:
done
- name: Publish nightly to Generic Package Registry
run: |
for f in gitea-mcp-extended_*.{tar.gz,zip}; do
API_BASE="https://git.lethalbits.com/api/packages/lethalbits/generic/gitea-mcp-extended/nightly"
echo "Publishing to: $API_BASE"
echo "Actor: ${{ gitea.actor }}"
ls -la gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip 2>/dev/null || true
for f in gitea-mcp-extended_*.tar.gz gitea-mcp-extended_*.zip; do
[ -f "$f" ] || continue
echo "Uploading $f..."
# Delete old nightly file first (can't overwrite)
curl -skf -X DELETE --user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
"${{ gitea.server_url }}/api/packages/lethalbits/generic/gitea-mcp-extended/nightly/${f}" || true
curl -skf --user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
curl -k -X DELETE --user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
"${API_BASE}/${f}" || true
HTTP_CODE=$(curl -k -o /tmp/upload_response -w '%{http_code}' \
--user "${{ gitea.actor }}:${{ secrets.GITHUB_TOKEN }}" \
--upload-file "$f" \
"${{ gitea.server_url }}/api/packages/lethalbits/generic/gitea-mcp-extended/nightly/${f}"
"${API_BASE}/${f}")
echo "HTTP response: $HTTP_CODE"
if [ "$HTTP_CODE" -lt 200 ] || [ "$HTTP_CODE" -ge 300 ]; then
echo "Upload failed! Response body:"
cat /tmp/upload_response
exit 1
fi
echo "Uploaded $f successfully"
done