Skip to content

Commit

Permalink
changes to release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Shweit committed Sep 2, 2024
1 parent 1f46e17 commit 62544eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ jobs:

- name: Upload to Modrinth
run: |
# Fetch and format the changelog
formatted_changelog=$(echo "${{ github.event.release.body }}" | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
# Perform the curl request with the formatted changelog
curl -X POST https://api.modrinth.com/v2/version \
-H "Authorization: Bearer ${{ secrets.MODRINTH_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "data={\"name\": \"${{ github.event.release.tag_name }}\", \"version_number\": \"${{ github.event.release.tag_name }}\", \"changelog\": \"${{ github.event.release.body }}\", \"dependencies\": [], \"game_versions\": [\"1.9\", \"1.9.1\", \"1.9.2\", \"1.9.3\", \"1.9.4\", \"1.10\", \"1.10.2\", \"1.11\", \"1.11.1\", \"1.11.2\", \"1.12\", \"1.12.1\", \"1.12.2\", \"1.13\", \"1.13.2\", \"1.14\", \"1.14.1\", \"1.14.2\", \"1.14.3\", \"1.14.4\", \"1.15\", \"1.15.1\", \"1.15.2\", \"1.16\", \"1.16.1\", \"1.16.2\", \"1.16.3\", \"1.16.4\", \"1.16.5\", \"1.17\", \"1.17.1\", \"1.18\", \"1.18.1\", \"1.18.2\", \"1.19\", \"1.19.1\", \"1.19.2\", \"1.19.3\", \"1.19.4\", \"1.20\", \"1.20.1\", \"1.20.2\", \"1.20.3\", \"1.20.4\", \"1.20.5\", \"1.20.6\", \"1.21\", \"1.21.1\"], \"version_type\": \"release\", \"loaders\": [\"fabric\", \"forge\", \"spigot\"], \"featured\": true, \"status\": \"listed\", \"requested_status\": \"listed\"}" \
-F "data={\"name\": \"${{ github.event.release.tag_name }}\", \"version_number\": \"${{ github.event.release.tag_name }}\", \"changelog\": \"$formatted_changelog\", \"dependencies\": [], \"game_versions\": [\"1.9\", \"1.9.1\", \"1.9.2\", \"1.9.3\", \"1.9.4\", \"1.10\", \"1.10.2\", \"1.11\", \"1.11.1\", \"1.11.2\", \"1.12\", \"1.12.1\", \"1.12.2\", \"1.13\", \"1.13.2\", \"1.14\", \"1.14.1\", \"1.14.2\", \"1.14.3\", \"1.14.4\", \"1.15\", \"1.15.1\", \"1.15.2\", \"1.16\", \"1.16.1\", \"1.16.2\", \"1.16.3\", \"1.16.4\", \"1.16.5\", \"1.17\", \"1.17.1\", \"1.18\", \"1.18.1\", \"1.18.2\", \"1.19\", \"1.19.1\", \"1.19.2\", \"1.19.3\", \"1.19.4\", \"1.20\", \"1.20.1\", \"1.20.2\", \"1.20.3\", \"1.20.4\", \"1.20.5\", \"1.20.6\", \"1.21\", \"1.21.1\"], \"version_type\": \"release\", \"loaders\": [\"fabric\", \"forge\", \"spigot\"], \"featured\": true, \"status\": \"listed\", \"requested_status\": \"listed\"}" \
-F "file=@target/MinecraftServerAPI-${{ github.event.release.tag_name }}.jar" \
-F "file_parts=file" \
-F "primary_file=file"
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}



0 comments on commit 62544eb

Please sign in to comment.