Skip to content

Commit 29b5216

Browse files
committed
Fix
1 parent f9ce634 commit 29b5216

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

.github/workflows/publish.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,30 @@ jobs:
4040
env:
4141
MOD_PORTAL_API_KEY: ${{ secrets.MOD_PORTAL_API_KEY }}
4242
run: |
43-
INIT_RESPONSE=$(curl -s -X POST \
43+
INIT_RESPONSE=$(curl -sS --retry 3 --retry-delay 5 -X POST \
4444
"https://mods.factorio.com/api/v2/mods/releases/init_upload" \
4545
-H "Authorization: Bearer $MOD_PORTAL_API_KEY" \
46-
-d "mod=${{ steps.info.outputs.name }}")
46+
-F "mod=${{ steps.info.outputs.name }}")
4747
48+
echo "Init response: $INIT_RESPONSE"
4849
UPLOAD_URL=$(echo "$INIT_RESPONSE" | jq -r '.upload_url')
4950
5051
if [ "$UPLOAD_URL" = "null" ] || [ -z "$UPLOAD_URL" ]; then
51-
echo "Failed to get upload URL: $INIT_RESPONSE"
52+
echo "Failed to get upload URL"
53+
echo "Error: $(echo "$INIT_RESPONSE" | jq -r '.message // .error // empty')"
5254
exit 1
5355
fi
5456
55-
UPLOAD_RESPONSE=$(curl -s -X POST \
57+
UPLOAD_RESPONSE=$(curl -sS --retry 3 --retry-delay 5 -X POST \
5658
"https://mods.factorio.com$UPLOAD_URL" \
5759
-F "file=@${{ steps.info.outputs.zip_name }}")
5860
61+
echo "Upload response: $UPLOAD_RESPONSE"
5962
SUCCESS=$(echo "$UPLOAD_RESPONSE" | jq -r '.success')
6063
6164
if [ "$SUCCESS" != "true" ]; then
62-
echo "Upload failed: $UPLOAD_RESPONSE"
65+
echo "Upload failed"
66+
echo "Error: $(echo "$UPLOAD_RESPONSE" | jq -r '.message // .error // empty')"
6367
exit 1
6468
fi
6569

0 commit comments

Comments
 (0)