Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleChest authored Jul 12, 2024
1 parent de20987 commit aa031cf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion scripts/GetBuildNumber.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 0 additions & 5 deletions scripts/PushToAPI.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}"

0 comments on commit aa031cf

Please sign in to comment.