fix: improve package publish debugging and hardcode API URL
- 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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user