mirror of
https://git.sanhost.net/sanasol/hytale-f2p
synced 2026-02-27 07:31:45 -03:00
fix: use HTTP for uploads, add debug output
- Switch upload URL to HTTP (port 3000) to bypass expired SSL cert - Add HTTP status code and response body to upload output for debugging - Upload URL kept in secret (FORGEJO_UPLOAD_URL), not exposed in workflow Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
38
.github/workflows/release.yml
vendored
38
.github/workflows/release.yml
vendored
@@ -52,12 +52,20 @@ jobs:
|
||||
run: |
|
||||
RELEASE_ID=$(curl -s "${FORGEJO_API}/repos/${GITHUB_REPOSITORY}/releases/tags/${{ github.ref_name }}" \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||
echo "Release ID: ${RELEASE_ID}"
|
||||
echo "Upload URL: ${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets"
|
||||
for file in dist/*.exe dist/*.exe.blockmap dist/latest.yml; do
|
||||
[ -f "$file" ] || continue
|
||||
echo "Uploading $file..."
|
||||
curl -sk --max-time 600 -X POST "${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" \
|
||||
echo "Uploading $file ($(stat -c%s "$file" 2>/dev/null || stat -f%z "$file") bytes)..."
|
||||
HTTP_CODE=$(curl -w '%{http_code}' --max-time 600 -X POST "${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-F "attachment=@${file}" || echo "Failed to upload $file"
|
||||
-F "attachment=@${file}" -o /tmp/upload_response.txt 2>/tmp/upload_err.txt)
|
||||
if [ "$HTTP_CODE" = "201" ]; then
|
||||
echo "OK — uploaded $(basename $file)"
|
||||
else
|
||||
echo "FAILED (HTTP $HTTP_CODE): $(cat /tmp/upload_response.txt)"
|
||||
echo "Curl stderr: $(cat /tmp/upload_err.txt)"
|
||||
fi
|
||||
done
|
||||
|
||||
build-macos:
|
||||
@@ -83,12 +91,19 @@ jobs:
|
||||
run: |
|
||||
RELEASE_ID=$(curl -s "${FORGEJO_API}/repos/${GITHUB_REPOSITORY}/releases/tags/${{ github.ref_name }}" \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||
echo "Release ID: ${RELEASE_ID}"
|
||||
for file in dist/*.dmg dist/*.zip dist/*.blockmap dist/latest-mac.yml; do
|
||||
[ -f "$file" ] || continue
|
||||
echo "Uploading $file..."
|
||||
curl -sk --max-time 600 -X POST "${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" \
|
||||
HTTP_CODE=$(curl -w '%{http_code}' --max-time 600 -X POST "${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-F "attachment=@${file}" || echo "Failed to upload $file"
|
||||
-F "attachment=@${file}" -o /tmp/upload_response.txt 2>/tmp/upload_err.txt)
|
||||
if [ "$HTTP_CODE" = "201" ]; then
|
||||
echo "OK — uploaded $(basename $file)"
|
||||
else
|
||||
echo "FAILED (HTTP $HTTP_CODE): $(cat /tmp/upload_response.txt)"
|
||||
echo "Curl stderr: $(cat /tmp/upload_err.txt)"
|
||||
fi
|
||||
done
|
||||
|
||||
build-linux:
|
||||
@@ -113,10 +128,17 @@ jobs:
|
||||
run: |
|
||||
RELEASE_ID=$(curl -s "${FORGEJO_API}/repos/${GITHUB_REPOSITORY}/releases/tags/${{ github.ref_name }}" \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" | python3 -c 'import sys,json; print(json.load(sys.stdin)["id"])')
|
||||
echo "Release ID: ${RELEASE_ID}"
|
||||
for file in dist/*.AppImage dist/*.AppImage.blockmap dist/*.deb dist/*.rpm dist/*.pacman dist/latest-linux.yml; do
|
||||
[ -f "$file" ] || continue
|
||||
echo "Uploading $file..."
|
||||
curl -sk --max-time 600 -X POST "${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" \
|
||||
echo "Uploading $file ($(stat -c%s "$file" 2>/dev/null || stat -f%z "$file") bytes)..."
|
||||
HTTP_CODE=$(curl -w '%{http_code}' --max-time 600 -X POST "${FORGEJO_UPLOAD}/repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}/assets?name=$(basename $file)" \
|
||||
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||
-F "attachment=@${file}" || echo "Failed to upload $file"
|
||||
-F "attachment=@${file}" -o /tmp/upload_response.txt 2>/tmp/upload_err.txt)
|
||||
if [ "$HTTP_CODE" = "201" ]; then
|
||||
echo "OK — uploaded $(basename $file)"
|
||||
else
|
||||
echo "FAILED (HTTP $HTTP_CODE): $(cat /tmp/upload_response.txt)"
|
||||
echo "Curl stderr: $(cat /tmp/upload_err.txt)"
|
||||
fi
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user