33
33
uses : gradle/actions/setup-gradle@v4 # Use v4 or latest stable version
34
34
35
35
# Gradle with the new updates doesn't support arguments
36
- - name : Build jar
36
+ - name : Build Bukkit and Velocity jar
37
37
run : ./gradlew shadowJar
38
38
39
+ - name : Build fabric jar
40
+ run : ./gradlew fabric:build
41
+
39
42
# 5. Find the Bukkit Shadow Jar file and extract its name
40
43
- name : Find Bukkit Shadow Jar and Extract Name
41
44
id : find_bukkit_jar
68
71
echo "filename=$JAR_FILENAME" >> $GITHUB_OUTPUT
69
72
shell : bash
70
73
71
- # 7. Upload the Bukkit Shadow Jar as a release asset
74
+ # 7. Find the Fabric Jar file and extract its name
75
+ - name : Find Fabric Jar and Extract Name
76
+ id : find_fabric_jar
77
+ run : |
78
+ JAR_PATH=$(find fabric/build/libs -maxdepth 1 -name '*.jar' -printf "%s %p\n" | sort -nr | head -n 1 | awk '{print $2}')
79
+ if [ -z "$JAR_PATH" ]; then
80
+ echo "Error: Could not find the shadow JAR file in fabric/build/libs/"
81
+ exit 1
82
+ fi
83
+ JAR_FILENAME=$(basename "$JAR_PATH")
84
+ echo "Found JAR path: $JAR_PATH"
85
+ echo "Found JAR filename: $JAR_FILENAME"
86
+ echo "path=$JAR_PATH" >> $GITHUB_OUTPUT
87
+ echo "filename=$JAR_FILENAME" >> $GITHUB_OUTPUT
88
+ shell : bash
89
+
90
+ # 8. Upload the Bukkit Shadow Jar as a release asset
72
91
- name : Upload Bukkit Release Asset
73
92
uses : svenstaro/upload-release-action@v2
74
93
with :
@@ -78,12 +97,22 @@ jobs:
78
97
tag : ${{ github.ref }} # The git tag associated with the release that triggered the workflow
79
98
overwrite : true # Optional: Replace asset with the same name if it already exists
80
99
81
- # 8 . Upload the Velocity Shadow Jar as a release asset
100
+ # 9 . Upload the Velocity Shadow Jar as a release asset
82
101
- name : Upload Velocity Release Asset
83
102
uses : svenstaro/upload-release-action@v2
84
103
with :
85
104
repo_token : ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions automatically
86
105
file : ${{ steps.find_velocity_jar.outputs.path }} # The path to the JAR found in the previous step
87
106
asset_name : ${{ steps.find_velocity_jar.outputs.filename }} # Use the filename extracted earlier
88
107
tag : ${{ github.ref }} # The git tag associated with the release that triggered the workflow
108
+ overwrite : true # Optional: Replace asset with the same name if it already exists
109
+
110
+ # 10. Upload the Fabric Jar as a release asset
111
+ - name : Upload Fabric Release Asset
112
+ uses : svenstaro/upload-release-action@v2
113
+ with :
114
+ repo_token : ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions automatically
115
+ file : ${{ steps.find_fabric_jar.outputs.path }} # The path to the JAR found in the previous step
116
+ asset_name : ${{ steps.find_fabric_jar.outputs.filename }} # Use the filename extracted earlier
117
+ tag : ${{ github.ref }} # The git tag associated with the release that triggered the workflow
89
118
overwrite : true # Optional: Replace asset with the same name if it already exists
0 commit comments