1
0
Fork 0
mirror of https://codeberg.org/xtex/xtex-mp-pack.git synced 2024-09-19 11:52:32 +00:00
xtex-mp-pack-staging/scripts/upload-to-mr.sh

29 lines
832 B
Bash
Raw Normal View History

2023-06-22 04:52:31 +00:00
#! /usr/bin/bash
# shellcheck source=/dev/null
source .env
version=$(grep '^version = "' pack.toml | sed -e 's/version = "//' | sed -e 's/"//')
payload=$(jo -p project_id=HsMwyVxf \
'file_parts=["file"]' featured=true 'loaders=["quilt"]' \
version_type=release \
"game_versions=[\"$(grep '^minecraft = "' pack.toml | sed -e 's/minecraft = "//' | sed -e 's/"//')\"]" \
dependencies=[] \
2023-06-22 05:01:07 +00:00
"version_number=$version" "name=$version" \
"changelog=$CHANGELOG")
2023-06-22 04:52:31 +00:00
echo "$payload"
rm -- *.mrpack
packwiz modrinth export
file=$(echo *.mrpack)
echo "$file"
curl -A "xtex-mp-pack scripts (HsMwyVxf)" \
-H "Authorization: $MODRINTH_TOKEN" \
-H "Content-Type: multipart/form-data" \
-X POST -F data="$payload" -F file="@$file" https://api.modrinth.com/v2/version
printf "\n"
echo Modrinth version uploaded