Skip to content

Commit f5a0fc6

Browse files
authored
Add BungeeCord jar to the release
1 parent 81680b9 commit f5a0fc6

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

.github/workflows/create_release.yml

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
uses: gradle/actions/setup-gradle@v4 # Use v4 or latest stable version
3434

3535
# Gradle with the new updates doesn't support arguments
36-
- name: Build Bukkit and Velocity jar
36+
- name: Build Bukkit, Velocity and BungeeCord jar
3737
run: ./gradlew shadowJar
3838

3939
- name: Build fabric jar
@@ -70,8 +70,24 @@ jobs:
7070
echo "path=$JAR_PATH" >> $GITHUB_OUTPUT
7171
echo "filename=$JAR_FILENAME" >> $GITHUB_OUTPUT
7272
shell: bash
73+
74+
# 7. Find the BungeeCord Shadow Jar file and extract its name
75+
- name: Find BungeeCord Shadow Jar and Extract Name
76+
id: find_bungeecord_jar
77+
run: |
78+
JAR_PATH=$(find bungeecord/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 bungeecord/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
7389

74-
# 7. Find the Fabric Jar file and extract its name
90+
# 8. Find the Fabric Jar file and extract its name
7591
- name: Find Fabric Jar and Extract Name
7692
id: find_fabric_jar
7793
run: |
@@ -87,7 +103,7 @@ jobs:
87103
echo "filename=$JAR_FILENAME" >> $GITHUB_OUTPUT
88104
shell: bash
89105

90-
# 8. Upload the Bukkit Shadow Jar as a release asset
106+
# 9. Upload the Bukkit Shadow Jar as a release asset
91107
- name: Upload Bukkit Release Asset
92108
uses: svenstaro/upload-release-action@v2
93109
with:
@@ -97,7 +113,7 @@ jobs:
97113
tag: ${{ github.ref }} # The git tag associated with the release that triggered the workflow
98114
overwrite: true # Optional: Replace asset with the same name if it already exists
99115

100-
# 9. Upload the Velocity Shadow Jar as a release asset
116+
# 10. Upload the Velocity Shadow Jar as a release asset
101117
- name: Upload Velocity Release Asset
102118
uses: svenstaro/upload-release-action@v2
103119
with:
@@ -107,12 +123,22 @@ jobs:
107123
tag: ${{ github.ref }} # The git tag associated with the release that triggered the workflow
108124
overwrite: true # Optional: Replace asset with the same name if it already exists
109125

110-
# 10. Upload the Fabric Jar as a release asset
126+
# 11. Upload the BungeeCord Shadow Jar as a release asset
127+
- name: Upload BungeeCord Release Asset
128+
uses: svenstaro/upload-release-action@v2
129+
with:
130+
repo_token: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions automatically
131+
file: ${{ steps.find_bungeecord_jar.outputs.path }} # The path to the JAR found in the previous step
132+
asset_name: ${{ steps.find_bungeecord_jar.outputs.filename }} # Use the filename extracted earlier
133+
tag: ${{ github.ref }} # The git tag associated with the release that triggered the workflow
134+
overwrite: true # Optional: Replace asset with the same name if it already exists
135+
136+
# 12. Upload the Fabric Jar as a release asset
111137
- name: Upload Fabric Release Asset
112138
uses: svenstaro/upload-release-action@v2
113139
with:
114140
repo_token: ${{ secrets.GITHUB_TOKEN }} # Provided by GitHub Actions automatically
115141
file: ${{ steps.find_fabric_jar.outputs.path }} # The path to the JAR found in the previous step
116142
asset_name: ${{ steps.find_fabric_jar.outputs.filename }} # Use the filename extracted earlier
117143
tag: ${{ github.ref }} # The git tag associated with the release that triggered the workflow
118-
overwrite: true # Optional: Replace asset with the same name if it already exists
144+
overwrite: true # Optional: Replace asset with the same name if it already exists

0 commit comments

Comments
 (0)