Commit b8c15506 authored by nanahira's avatar nanahira

add deploy ci

parent 83bdd3be
Pipeline #38969 canceled with stages
in 79 minutes and 11 seconds
#!/bin/bash
set -o errexit
apt update; apt -y install curl jq
apiRoot=https://api.moecube.com
loginInfo=$(curl -sL -X POST $apiRoot/accounts/signin -d account=$MYCARD_USERNAME -d password=$MYCARD_PASSWORD)
token=$(echo $loginInfo | jq '.token' | sed 's/"//g')
header="Authorization: $token"
echo "Login succeeded."
appName="mdpro3"
handleErrorMessage() {
rawJsonInput="$1"
successInfo=$(echo "$rawJsonInput" | jq '.success')
if [[ "$successInfo" != "true" ]]; then
echo "$rawJsonInput"
exit 1
fi
}
runForDepot() {
platform=$1
archivePath="./dist/$appName-$appVersion-$platform.tar.zst"
suffix="?platform=$platform&locale=generic&arch=generic"
echo "Uploading $archivePath"
result=$(curl -H "$header" -X POST "$apiRoot/release/api/build/$appName/${appVersion}${suffix}" -F file=@$archivePath)
handleErrorMessage "$result"
echo "$result" | jq .
}
runForDepot win32
runForDepot linux
runForDepot darwin
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