mirror of
https://github.com/LeavesMC/Leaves.git
synced 2025-12-20 07:19:35 +00:00
--------- Co-authored-by: MC_XiaoHei <xiaohei.xor7studio@foxmail.com> Co-authored-by: Bluemangoo <chenfy2006@qq.com>
15 lines
393 B
Bash
15 lines
393 B
Bash
#!/bin/bash
|
|
|
|
prop() {
|
|
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
|
|
}
|
|
|
|
latest_build=$(curl -s 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
|
|
else
|
|
echo "Error: Received non-integer value from API: $latest_build"
|
|
exit 1
|
|
fi
|