diff --git a/scripts/GetBuildNumber.sh b/scripts/GetBuildNumber.sh index 622caca1..c28ba320 100644 --- a/scripts/GetBuildNumber.sh +++ b/scripts/GetBuildNumber.sh @@ -4,7 +4,7 @@ prop() { grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//' } -latest_build=$(curl -s -L "https://api.leavesmc.org/projects/leaves/versions/$(prop mcVersion)/latestGroupBuildId") +latest_build=$(curl -s -L "https://api.leavesmc.org/v2/projects/leaves/versions/$(prop mcVersion)/latestGroupBuildId") if [[ $latest_build =~ ^[0-9]+$ ]]; then echo "BUILD_NUMBER=$((latest_build + 1))" >> "$GITHUB_ENV" diff --git a/scripts/PushToAPI.sh b/scripts/PushToAPI.sh index b9a10cb1..1cf7cd49 100644 --- a/scripts/PushToAPI.sh +++ b/scripts/PushToAPI.sh @@ -23,9 +23,4 @@ changes=$(git log --pretty='%H<<<%s>>>' -"$number" | sed ':a;N;$!ba;s/\n//g') jar_name="leaves-$mcversion.jar" jar_sha256=`sha256 $jar_name` -# v1 -curl --location --request POST "https://api.leavesmc.org/new_release" --header "Content-Type: application/json" --data-raw "{\"project_id\":\"$project_id\",\"project_name\":\"$project_name\",\"version\":\"$mcversion\",\"time\":\"$ctime\",\"channel\":\"$channel\",\"promoted\":$promoted,\"changes\":\"$changes\",\"downloads\":{\"application\":{\"name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"url\":\"https://github.com/LeavesMC/Leaves/releases/download/$tag/$jar_name\"}},\"secret\":\"$secret\"}" -curl --location --request POST "https://api.leavesmc.org/upload_file" -F "file=@$jar_name" -F "filename=$jar_name" -F "filehash=$jar_sha256" -F "secret=$secret" - -# v2 curl --location --request POST "https://api.leavesmc.org/v2/commit/build" --header "Content-Type: application/json" --header "Authentication: Bearer $secret_v2" --data-raw "{\"project_id\":\"$project_id\",\"version\":\"$mcversion\",\"channel\":\"$channel\",\"changes\":\"$changes\",\"jar_name\":\"$jar_name\",\"sha256\":\"$jar_sha256\",\"tag\":\"$tag\"}" \ No newline at end of file