Commit b382b081 authored by nanahira's avatar nanahira

Update upload-packager.sh

parent 67f6ea7c
...@@ -12,13 +12,27 @@ echo "Login succeeded." ...@@ -12,13 +12,27 @@ echo "Login succeeded."
appName="ygopro" appName="ygopro"
handleErrorMessage() {
rawJsonInput="$1"
successInfo=$(echo "$rawJsonInput" | jq '.success')
statusCode=$(echo "$rawJsonInput" | jq '.statusCode')
if [[ "$successInfo" != "true" ]]; then
failMessage=$(echo "$rawJsonInput" | jq '.success')
echo "$rawJsonInput"
exit 1
fi
}
runForDepot() { runForDepot() {
platform=$1 platform=$1
locale=$2 locale=$2
archivePath="./dist/ygopro-$appVersion-$platform-$locale.tar.zst" archivePath="./dist/ygopro-$appVersion-$platform-$locale.tar.zst"
suffix="?platform=$platform&locale=$locale&arch=generic" suffix="?platform=$platform&locale=$locale&arch=generic"
echo "Uploading $archivePath" echo "Uploading $archivePath"
curl -H "$header" -X POST "$apiRoot/release/api/build/$appName/${appVersion}${suffix}" -F file=@$archivePath result=$(curl -H "$header" -X POST "$apiRoot/release/api/build/$appName/${appVersion}${suffix}" -F file=@$archivePath)
handleErrorMessage "$result"
echo "$result" | jq .
} }
runForDepot win32 zh-CN runForDepot win32 zh-CN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment