-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcf-upload.sh
More file actions
35 lines (30 loc) · 759 Bytes
/
cf-upload.sh
File metadata and controls
35 lines (30 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
RELEASE_NAME="$1"
RELEASE_MESSAGE="$2"
GAME_VERSIONS=[12345]
FILE_PATH="./MultiLanguage.zip"
CF_METADATA=$(cat <<-EOF
{
"displayName": "$RELEASE_NAME",
"releaseType": "release",
"changelog": "$RELEASE_MESSAGE",
"changelogType": "markdown",
"gameVersions": $GAME_VERSIONS,
}
EOF
)
response=$(curl -sS \
-o response.txt \
-w "%{http_code}" \
-H "X-API-TOKEN: $CF_API_TOKEN" \
-F "metadata=$CF_METADATA" \
-F "file=@$FILE_PATH" \
"https://wow.curseforge.com/api/projects/965777/upload-file")
http_status=$(echo "$response" | tail -n1)
if [ "$http_status" -eq 200 ]; then
echo "CurseForge upload successful"
else
echo "CurseForge upload failed, HTTP-code: $http_status"
cat response.txt
exit 1
fi