1
- name : Create Release Asset
1
+ name : Create Release Assets
2
2
3
3
# Trigger the workflow only when a release is published
4
4
on :
36
36
- name : Build jar
37
37
run : ./gradlew shadowJar
38
38
39
- # 5. Find the specific Shadow Jar file and extract its name
40
- - name : Find Shadow Jar and Extract Name
41
- id : find_jar
39
+ # 5. Find the Bukkit Shadow Jar file and extract its name
40
+ - name : Find Bukkit Shadow Jar and Extract Name
41
+ id : find_bukkit_jar
42
42
run : |
43
43
JAR_PATH=$(find bukkit/build/libs -maxdepth 1 -name '*.jar' -printf "%s %p\n" | sort -nr | head -n 1 | awk '{print $2}')
44
44
if [ -z "$JAR_PATH" ]; then
@@ -52,12 +52,38 @@ jobs:
52
52
echo "filename=$JAR_FILENAME" >> $GITHUB_OUTPUT
53
53
shell : bash
54
54
55
- # 6. Upload the Shadow Jar as a release asset
56
- - name : Upload Release Asset
55
+ # 6. Find the Velocity Shadow Jar file and extract its name
56
+ - name : Find Velocity Shadow Jar and Extract Name
57
+ id : find_velocity_jar
58
+ run : |
59
+ JAR_PATH=$(find velocity/build/libs -maxdepth 1 -name '*.jar' -printf "%s %p\n" | sort -nr | head -n 1 | awk '{print $2}')
60
+ if [ -z "$JAR_PATH" ]; then
61
+ echo "Error: Could not find the shadow JAR file in velocity/build/libs/"
62
+ exit 1
63
+ fi
64
+ JAR_FILENAME=$(basename "$JAR_PATH")
65
+ echo "Found JAR path: $JAR_PATH"
66
+ echo "Found JAR filename: $JAR_FILENAME"
67
+ echo "path=$JAR_PATH" >> $GITHUB_OUTPUT
68
+ echo "filename=$JAR_FILENAME" >> $GITHUB_OUTPUT
69
+ shell : bash
70
+
71
+ # 7. Upload the Bukkit Shadow Jar as a release asset
72
+ - name : Upload Bukkit Release Asset
57
73
uses : svenstaro/upload-release-action@v2
58
74
with :
59
75
repo_token : ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions automatically
60
- file : ${{ steps.find_jar .outputs.path }} # The path to the JAR found in the previous step
61
- asset_name : ${{ steps.find_jar .outputs.filename }} # Use the filename extracted earlier
76
+ file : ${{ steps.find_bukkit_jar .outputs.path }} # The path to the JAR found in the previous step
77
+ asset_name : ${{ steps.find_bukkit_jar .outputs.filename }} # Use the filename extracted earlier
62
78
tag : ${{ github.ref }} # The git tag associated with the release that triggered the workflow
63
79
overwrite : true # Optional: Replace asset with the same name if it already exists
80
+
81
+ # 8. Upload the Velocity Shadow Jar as a release asset
82
+ - name : Upload Velocity Release Asset
83
+ uses : svenstaro/upload-release-action@v2
84
+ with :
85
+ repo_token : ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions automatically
86
+ file : ${{ steps.find_velocity_jar.outputs.path }} # The path to the JAR found in the previous step
87
+ asset_name : ${{ steps.find_velocity_jar.outputs.filename }} # Use the filename extracted earlier
88
+ tag : ${{ github.ref }} # The git tag associated with the release that triggered the workflow
89
+ overwrite : true # Optional: Replace asset with the same name if it already exists
0 commit comments