Skip to content

Commit 389e66f

Browse files
committed
fix: github action builder
1 parent 4301003 commit 389e66f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

.github/workflows/build_and_push.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
elif [ -f build.gradle ] || [ -f build.gradle.kts ]; then
5858
chmod +x ./gradlew
5959
./gradlew clean build
60-
artifact=$(ls build/libs/*.jar | head -n1)
60+
artifact=$(ls build/libs/*.jar | grep -v -- '-dev.jar' | head -n1)
6161
else
6262
echo "No recognized build file found in $branch"
6363
continue
@@ -67,11 +67,9 @@ jobs:
6767
6868
# 解析文件名得到 version(去掉 .jar)
6969
filename=$(basename "$artifact")
70-
version="${filename%.jar}"
71-
echo "Version: $version"
70+
fabric_ver=$(echo "$filename" | grep -oP 'mc\K[0-9]+\.[0-9]+(\.[0-9]+)?')
71+
echo "MC Version: $fabric_ver"
7272
73-
# 根据 Fabric 版本生成 JSON 数组形式 game-versions
74-
fabric_ver=$(echo "$version" | sed 's/^Fabric-//')
7573
case "$fabric_ver" in
7674
1.16.5) game_versions='["1.16.x"]';;
7775
1.17.1) game_versions='["1.17.x"]';;

0 commit comments

Comments
 (0)