mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-24 09:39:40 -05:00
Former-commit-id: 3412472c57b70c919895400e283e775adf37236d [formerly ca908e93b604e76f53cbacfdd50656cd0f57a3bb] Former-commit-id: 94d28c8c8757299e8f14b0d1a7dd9690cedfd055
33 lines
891 B
Bash
33 lines
891 B
Bash
#!/bin/sh
|
|
echo "Deploy jar to dev.bukkit.org"
|
|
|
|
# 获取从install完成后输出的JAR文件的名字
|
|
filename="./jarname.txt"
|
|
|
|
if [ ! -f $filename ]
|
|
then
|
|
echo "The file $filename doesn't exist."
|
|
exit 1
|
|
fi
|
|
|
|
# 定义变量count,其值为0
|
|
count=0
|
|
|
|
# 下载JSON库
|
|
wget -O "jq" "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64"
|
|
|
|
# 设置运行权限
|
|
chmod +x "./jq"
|
|
|
|
# JAR为编译后jar文件名称
|
|
read JAR < $filename
|
|
xToken=$1
|
|
curl -X POST -H "X-Api-Token: $xToken" -F 'metadata={"changelog":"Auto upload by TravisCI, see update details on spigotmc.org","gameVersions":[7330,7132,7081],"releaseType":"release"}' -F "file=@./push/$JAR" -s "https://dev.bukkit.org/api/projects/320536/upload-file" > fileid.json
|
|
cat fileid.json
|
|
jq '.id' > fileid.txt
|
|
cat fileid.txt
|
|
echo -e "\nTotal $count linces read and deployed."
|
|
|
|
#退出脚本,且退出状态码为0
|
|
exit 0
|