Commit c8122a85 by Jonathan Thomas

- Removing artifacts

- Change branch back to develop
- Added curl retries and sleep (no spamming api endpoints)
parent 35d0144d
...@@ -61,7 +61,7 @@ build_mod: ...@@ -61,7 +61,7 @@ build_mod:
- creaturechat-*.jar - creaturechat-*.jar
- fabric-api-*.jar - fabric-api-*.jar
only: only:
- new-deploy-ci - develop
tags: tags:
- minecraft - minecraft
...@@ -73,10 +73,7 @@ Modrinth: ...@@ -73,10 +73,7 @@ Modrinth:
- chmod +x ./deploy-modrinth.sh - chmod +x ./deploy-modrinth.sh
- ./deploy-modrinth.sh - ./deploy-modrinth.sh
only: only:
- new-deploy-ci - develop
artifacts:
paths:
- creaturechat*.jar
tags: tags:
- minecraft - minecraft
...@@ -88,9 +85,6 @@ CurseForge: ...@@ -88,9 +85,6 @@ CurseForge:
- chmod +x ./deploy-curseforge.sh - chmod +x ./deploy-curseforge.sh
- ./deploy-curseforge.sh - ./deploy-curseforge.sh
only: only:
- new-deploy-ci - develop
artifacts:
paths:
- creaturechat*.jar
tags: tags:
- minecraft - minecraft
...@@ -2,20 +2,18 @@ ...@@ -2,20 +2,18 @@
set -e set -e
TEST_KEY=${TEST_KEY}
echo "TEST_KEY: $TEST_KEY"
CURSEFORGE_API_KEY=${CURSEFORGE_API_KEY} CURSEFORGE_API_KEY=${CURSEFORGE_API_KEY}
CHANGELOG_FILE="./CHANGELOG.md" CHANGELOG_FILE="./CHANGELOG.md"
API_URL="https://minecraft.curseforge.com/api" API_URL="https://minecraft.curseforge.com/api"
PROJECT_ID=1012118 PROJECT_ID=1012118
DEPENDENCY_SLUG="fabric-api" DEPENDENCY_SLUG="fabric-api"
USER_AGENT="CreatureChat-Minecraft-Mod:curseforge@owlmaddie.com" USER_AGENT="CreatureChat-Minecraft-Mod:curseforge@owlmaddie.com"
SLEEP_DURATION=10
# Function to fetch game version IDs # Function to fetch game version IDs
fetch_game_version_ids() { fetch_game_version_ids() {
local minecraft_version="$1" local minecraft_version="$1"
local response=$(curl -s -H "X-Api-Token: $CURSEFORGE_API_KEY" "$API_URL/game/versions") local response=$(curl --retry 3 --retry-delay 5 -s -H "X-Api-Token: $CURSEFORGE_API_KEY" "$API_URL/game/versions")
local client_id=$(echo "$response" | jq -r '.[] | select(.name == "Client") | .id') local client_id=$(echo "$response" | jq -r '.[] | select(.name == "Client") | .id')
local server_id=$(echo "$response" | jq -r '.[] | select(.name == "Server") | .id') local server_id=$(echo "$response" | jq -r '.[] | select(.name == "Server") | .id')
...@@ -90,9 +88,12 @@ for FILE in creaturechat*.jar; do ...@@ -90,9 +88,12 @@ for FILE in creaturechat*.jar; do
# Write the payload to a temporary file to avoid issues with large payloads # Write the payload to a temporary file to avoid issues with large payloads
echo "$PAYLOAD" > metadata.json echo "$PAYLOAD" > metadata.json
# Sleep for the specified duration
sleep $SLEEP_DURATION
# Upload the version with the file # Upload the version with the file
echo "Uploading $FILE_BASENAME as version $VERSION_NUMBER..." echo "Uploading $FILE_BASENAME as version $VERSION_NUMBER..."
HTTP_RESPONSE=$(curl --fail -o response.txt -w "\nHTTP Code: %{http_code}\n" -X POST "$API_URL/projects/$PROJECT_ID/upload-file" \ HTTP_RESPONSE=$(curl --retry 3 --retry-delay 5 --fail -o response.txt -w "\nHTTP Code: %{http_code}\n" -X POST "$API_URL/projects/$PROJECT_ID/upload-file" \
-H "X-Api-Token: $CURSEFORGE_API_KEY" \ -H "X-Api-Token: $CURSEFORGE_API_KEY" \
-H "User-Agent: $USER_AGENT" \ -H "User-Agent: $USER_AGENT" \
-F "metadata=<metadata.json;type=application/json" \ -F "metadata=<metadata.json;type=application/json" \
......
...@@ -2,16 +2,13 @@ ...@@ -2,16 +2,13 @@
set -e set -e
TEST_KEY=${TEST_KEY}
echo "TEST_KEY: $TEST_KEY"
MODRINTH_API_KEY=${MODRINTH_API_KEY} MODRINTH_API_KEY=${MODRINTH_API_KEY}
CHANGELOG_FILE="./CHANGELOG.md" CHANGELOG_FILE="./CHANGELOG.md"
API_URL="https://api.modrinth.com/v2" API_URL="https://api.modrinth.com/v2"
USER_AGENT="CreatureChat-Minecraft-Mod:modrinth@owlmaddie.com" USER_AGENT="CreatureChat-Minecraft-Mod:modrinth@owlmaddie.com"
PROJECT_ID="rvR0de1E" PROJECT_ID="rvR0de1E"
AUTHOR_ID="k6RiShdd" AUTHOR_ID="k6RiShdd"
SLEEP_DURATION=10
# Read the first changelog block # Read the first changelog block
CHANGELOG=$(awk '/^## \[/{ if (p) exit; p=1 } p' "$CHANGELOG_FILE") CHANGELOG=$(awk '/^## \[/{ if (p) exit; p=1 } p' "$CHANGELOG_FILE")
...@@ -47,7 +44,7 @@ for FILE in creaturechat*.jar; do ...@@ -47,7 +44,7 @@ for FILE in creaturechat*.jar; do
# Check if the version already exists # Check if the version already exists
echo "Checking if version $VERSION_NUMBER already exists on Modrinth..." echo "Checking if version $VERSION_NUMBER already exists on Modrinth..."
if curl --silent --fail -X GET "$API_URL/project/creaturechat/version/$VERSION_NUMBER" > /dev/null 2>&1; then if curl --retry 3 --retry-delay 5 --silent --fail -X GET "$API_URL/project/creaturechat/version/$VERSION_NUMBER" > /dev/null 2>&1; then
echo "Version $VERSION_NUMBER already exists, skipping." echo "Version $VERSION_NUMBER already exists, skipping."
continue continue
fi fi
...@@ -85,9 +82,12 @@ for FILE in creaturechat*.jar; do ...@@ -85,9 +82,12 @@ for FILE in creaturechat*.jar; do
# Write the payload to a temporary file to avoid issues with large payloads # Write the payload to a temporary file to avoid issues with large payloads
echo "$PAYLOAD" > metadata.json echo "$PAYLOAD" > metadata.json
# Sleep for the specified duration
sleep $SLEEP_DURATION
# Upload the version with the file # Upload the version with the file
echo "Uploading $FILE_BASENAME as version $VERSION_NUMBER..." echo "Uploading $FILE_BASENAME as version $VERSION_NUMBER..."
HTTP_RESPONSE=$(curl --fail -o response.txt -w "\nHTTP Code: %{http_code}\n" -X POST "$API_URL/version" \ HTTP_RESPONSE=$(curl --retry 3 --retry-delay 5 --fail -o response.txt -w "\nHTTP Code: %{http_code}\n" -X POST "$API_URL/version" \
-H "Authorization: $MODRINTH_API_KEY" \ -H "Authorization: $MODRINTH_API_KEY" \
-H "User-Agent: $USER_AGENT" \ -H "User-Agent: $USER_AGENT" \
-F "data=@metadata.json;type=application/json;filename=metadata.json" \ -F "data=@metadata.json;type=application/json;filename=metadata.json" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment