@@ -59,28 +59,33 @@ jobs:
5959 LOWER_DP=$(jq -r '.pack.supported_formats[0]' pack.mcmeta)
6060 UPPER_DP=$(jq -r '.pack.supported_formats[1]' pack.mcmeta)
6161 else
62- echo "::error:: pack.mcmeta not found!"
62+ echo "::error:: pack.mcmeta file not found!"
6363 exit 1
6464 fi
6565 echo "Lower data pack format: $LOWER_DP, Upper: $UPPER_DP"
6666
6767 echo "Fetching versions from Spyglass API..."
6868 API_JSON=$(curl -s https://api.spyglassmc.com/mcje/versions || true)
69- if [ -z "$API_JSON" ]; then
69+ if [ -z "$API_JSON" ] || ! echo "$API_JSON" | jq empty > /dev/null 2>&1 ; then
7070 echo "::error:: Spyglass API unreachable!"
71+ echo " Response: $API_JSON"
7172 exit 1
7273 fi
7374
7475 # Determine MC_LOWER: oldest version matching LOWER_DP
7576 # LIMITATION: Mod loaders don't accept snapshot versions, so we assume lower pack format is a release (and not a snapshot)
7677 MC_LOWER=$(echo "$API_JSON" | jq -r --argjson lower_dp "$LOWER_DP" '[.[] | select(.data_pack_version == $lower_dp and .type == "release")] | sort_by(.release_time | sub("\\+00:00$"; "Z") | fromdateiso8601) | .[0].id')
77- if [ "$MC_LOWER" = "null" ]; then
78+ if [ -z "$MC_LOWER" ] || [ "$MC_LOWER" = "null" ]; then
7879 echo "::error:: Expected a release version for pack format ($LOWER_DP), but none was found!"
7980 exit 1
8081 fi
8182
8283 # Determine MC_UPPER: newest version matching UPPER_DP
8384 CHOSEN_UPPER_OBJ=$(echo "$API_JSON" | jq -c --argjson upper_dp "$UPPER_DP" '[.[] | select(.data_pack_version == $upper_dp)] | sort_by(.release_time | sub("\\+00:00$"; "Z") | fromdateiso8601) | reverse | .[0]')
85+ if [ -z "$CHOSEN_UPPER_OBJ" ] || [ "$CHOSEN_UPPER_OBJ" = "null" ]; then
86+ echo "::error:: Expected a version for pack format ($UPPER_DP), but none was found!"
87+ exit 1
88+ fi
8489 MC_UPPER=$(echo "$CHOSEN_UPPER_OBJ" | jq -r '.id')
8590
8691 echo "Found MC_LOWER=$MC_LOWER, MC_UPPER=$MC_UPPER"
@@ -217,19 +222,19 @@ jobs:
217222 - name : Upload artifacts
218223 id : upload
219224 uses : actions/upload-artifact@v4
220- if : github.event.inputs.dry_run == true
225+ if : github.event.inputs.dry_run == ' true'
221226 with :
222- name : " ${{ github.event.repository.name }} v${{ env.TAG }} Test Builds (Unzip Me)"
227+ name : " ${{ github.event.repository.name }} v${{ github.event.inputs.tag }} Test Builds (Unzip Me)"
223228 path : |
224- ./${{ github.event.repository.name }}-v${{ env.TAG }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack.zip
225- ./${{ github.event.repository.name }}-v${{ env.TAG }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar
226- ./${{ github.event.repository.name }}-v${{ env.TAG }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-resourcepack.zip
229+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack.zip
230+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-mod.jar
231+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-resourcepack.zip
227232
228233 # Upload
229234 - name : Upload data pack version to Modrinth
230235 id : upload_modrinth_dp
231236 uses : Kir-Antipov/mc-publish@v3.3
232- if : steps.check_datapack_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == false
237+ if : steps.check_datapack_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == ' false'
233238 with :
234239 modrinth-id : zrzYrlm0
235240 modrinth-token : ${{ secrets.MODRINTH_TOKEN }}
@@ -244,12 +249,12 @@ jobs:
244249 loaders : |
245250 datapack
246251 files : |
247- ./${{ github.event.repository.name }}-* .zip
252+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack .zip
248253
249254 - name : Upload mod version to Modrinth
250255 id : upload_modrinth_mod
251256 uses : Kir-Antipov/mc-publish@v3.3
252- if : steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == false
257+ if : steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == ' false'
253258 with :
254259 modrinth-id : zrzYrlm0
255260 modrinth-token : ${{ secrets.MODRINTH_TOKEN }}
@@ -269,16 +274,16 @@ jobs:
269274 midnightlib(optional){modrinth:codAaoxh}
270275 loaders : |
271276 fabric
272- forge
273277 quilt
278+ forge
274279 neoforge
275280 files : |
276- ./${{ github.event.repository.name }}-* -mod.jar
281+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }} -mod.jar
277282
278283 - name : Upload data pack version to CurseForge
279284 id : upload_curseforge_dp
280285 uses : Kir-Antipov/mc-publish@v3.3
281- if : steps.check_datapack_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == false
286+ if : steps.check_datapack_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == ' false'
282287 with :
283288 curseforge-id : 811803
284289 curseforge-token : ${{ secrets.CURSEFORGE_TOKEN }}
@@ -293,12 +298,12 @@ jobs:
293298 loaders : |
294299 datapack
295300 files : |
296- ./${{ github.event.repository.name }}-* .zip
301+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }}-datapack .zip
297302
298303 - name : Upload mod version to CurseForge
299304 id : upload_curseforge_mod
300305 uses : Kir-Antipov/mc-publish@v3.3
301- if : steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == false
306+ if : steps.check_mod_folder.outputs.files_exists == 'true' && github.event.inputs.dry_run == ' false'
302307 with :
303308 curseforge-id : 1223719
304309 curseforge-token : ${{ secrets.CURSEFORGE_TOKEN }}
@@ -322,15 +327,15 @@ jobs:
322327 forge
323328 neoforge
324329 files : |
325- ./${{ github.event.repository.name }}-* -mod.jar
330+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }} -mod.jar
326331
327332 - name : Add changelog header for GitHub release
328- if : github.event.inputs.dry_run == false
333+ if : github.event.inputs.dry_run == ' false'
329334 run : sed -i '1i_Changelog:_' CHANGES.md
330335 - name : Upload outputs to GitHub releases
331336 id : upload_github
332337 uses : Kir-Antipov/mc-publish@v3.3
333- if : github.event.inputs.dry_run == false
338+ if : github.event.inputs.dry_run == ' false'
334339 with :
335340 github-token : ${{ secrets.GITHUB_TOKEN }}
336341 github-tag : v${{ github.event.inputs.tag }}
@@ -341,7 +346,7 @@ jobs:
341346 changelog-file : CHANGES.md
342347
343348 files : |
344- ./${{ github.event.repository.name }}-*.@(zip|jar)
349+ ./${{ github.event.repository.name }}-v${{ github.event.inputs.tag }}-mc${{ env.MC_HUMAN_VERSION_RANGE }} *.@(zip|jar)
345350
346351 # Build summary
347352 - name : Set job summary
@@ -355,7 +360,7 @@ jobs:
355360 <img alt=\"✅ Success\" src=\"https://raw.githubusercontent.com/Mqxx/GitHub-Markdown/main/blockquotes/badge/dark-theme/success.svg\">
356361 </picture><br>
357362
358- **${{ github.event.repository.name }} v${{ github.event.inputs.tag }}** for **mc ${{ env.MC_HUMAN_VERSION_RANGE }}** published successfully!
363+ **${{ github.event.repository.name }} v${{ github.event.inputs.tag }}** for **Minecraft ${{ env.MC_HUMAN_VERSION_RANGE }}** published successfully!
359364
360365 [View Changelog](https://github.com/${{ github.repository }}/blob/v${{ github.event.inputs.tag }}/CHANGES.md)
361366
0 commit comments