Commit c3112c6b by Jonathan Thomas

Merge branch 'lead-behavior' into 'develop'

Fixing deploy scripts for both Modrinth and CurseForge

See merge request !17
parents 4bb96099 ba82e698
Pipeline #12732 passed with stages
in 2 minutes 26 seconds
...@@ -4,6 +4,11 @@ All notable changes to **CreatureChat** are documented in this file. The format ...@@ -4,6 +4,11 @@ All notable changes to **CreatureChat** are documented in this file. The format
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html). [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Fixed
- Fixed a regression caused by adding a "-forge" suffix to one of our builds
## [1.1.0] - 2024-08-07 ## [1.1.0] - 2024-08-07
### Added ### Added
......
...@@ -90,7 +90,7 @@ for FILE in creaturechat*.jar; do ...@@ -90,7 +90,7 @@ for FILE in creaturechat*.jar; do
echo "--------------$FILE----------------" echo "--------------$FILE----------------"
FILE_BASENAME=$(basename "$FILE") FILE_BASENAME=$(basename "$FILE")
OUR_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/creaturechat-\(.*\)+.*\.jar/\1/p') OUR_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/creaturechat-\(.*\)+.*\.jar/\1/p')
MINECRAFT_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/.*+\(.*\)\.jar/\1/p') MINECRAFT_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/.*+\([0-9.]*\)\(-forge\)*\.jar/\1/p')
VERSION_NUMBER="$OUR_VERSION-$MINECRAFT_VERSION" VERSION_NUMBER="$OUR_VERSION-$MINECRAFT_VERSION"
# Verify that OUR_VERSION and MINECRAFT_VERSION are not empty and OUR_VERSION matches VERSION # Verify that OUR_VERSION and MINECRAFT_VERSION are not empty and OUR_VERSION matches VERSION
...@@ -112,10 +112,10 @@ for FILE in creaturechat*.jar; do ...@@ -112,10 +112,10 @@ for FILE in creaturechat*.jar; do
# Determine the dependency slugs and loader ID based on the file name # Determine the dependency slugs and loader ID based on the file name
if [[ "$FILE_BASENAME" == *"-forge.jar" ]]; then if [[ "$FILE_BASENAME" == *"-forge.jar" ]]; then
DEPENDENCY_SLUGS=("sinytra-connector" "forgified-fabric-api") DEPENDENCY_SLUGS=("sinytra-connector" "forgified-fabric-api")
LOADER_ID="${GAME_VERSION_IDS[3]}" GAME_VERSIONS="[${GAME_VERSION_IDS[0]}, ${GAME_VERSION_IDS[1]}, ${GAME_VERSION_IDS[3]}, ${GAME_VERSION_IDS[4]}]"
else else
DEPENDENCY_SLUGS=("fabric-api") DEPENDENCY_SLUGS=("fabric-api")
LOADER_ID="${GAME_VERSION_IDS[2]}" GAME_VERSIONS="[${GAME_VERSION_IDS[0]}, ${GAME_VERSION_IDS[1]}, ${GAME_VERSION_IDS[2]}, ${GAME_VERSION_IDS[4]}]"
fi fi
# Create dependencies array for payload # Create dependencies array for payload
...@@ -125,7 +125,7 @@ for FILE in creaturechat*.jar; do ...@@ -125,7 +125,7 @@ for FILE in creaturechat*.jar; do
PAYLOAD=$(jq -n --arg changelog "$CHANGELOG" \ PAYLOAD=$(jq -n --arg changelog "$CHANGELOG" \
--arg changelogType "markdown" \ --arg changelogType "markdown" \
--arg displayName "$FILE_BASENAME" \ --arg displayName "$FILE_BASENAME" \
--argjson gameVersions "$(printf '%s\n' "${GAME_VERSION_IDS[@]}" | jq -R . | jq -s .)" \ --argjson gameVersions "$GAME_VERSIONS" \
--argjson gameVersionTypeIds "[$GAME_TYPE_ID]" \ --argjson gameVersionTypeIds "[$GAME_TYPE_ID]" \
--arg releaseType "release" \ --arg releaseType "release" \
--argjson relations "$RELATIONS" \ --argjson relations "$RELATIONS" \
......
...@@ -34,7 +34,7 @@ for FILE in creaturechat*.jar; do ...@@ -34,7 +34,7 @@ for FILE in creaturechat*.jar; do
echo "--------------$FILE----------------" echo "--------------$FILE----------------"
FILE_BASENAME=$(basename "$FILE") FILE_BASENAME=$(basename "$FILE")
OUR_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/creaturechat-\(.*\)+.*\.jar/\1/p') OUR_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/creaturechat-\(.*\)+.*\.jar/\1/p')
MINECRAFT_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/.*+\(.*\)\.jar/\1/p') MINECRAFT_VERSION=$(echo "$FILE_BASENAME" | sed -n 's/.*+\([0-9.]*\)\(-forge\)*\.jar/\1/p')
VERSION_NUMBER="$OUR_VERSION+$MINECRAFT_VERSION" VERSION_NUMBER="$OUR_VERSION+$MINECRAFT_VERSION"
# Verify that OUR_VERSION and MINECRAFT_VERSION are not empty and OUR_VERSION matches VERSION # Verify that OUR_VERSION and MINECRAFT_VERSION are not empty and OUR_VERSION matches VERSION
...@@ -52,14 +52,6 @@ for FILE in creaturechat*.jar; do ...@@ -52,14 +52,6 @@ for FILE in creaturechat*.jar; do
DEPENDENCIES='[{"project_id": "P7dR8mSH", "dependency_type": "required"}]' DEPENDENCIES='[{"project_id": "P7dR8mSH", "dependency_type": "required"}]'
fi fi
# Check if the version already exists
echo "Checking if version $VERSION_NUMBER already exists on Modrinth..."
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."
continue
fi
echo "Version $VERSION_NUMBER does not exist. Preparing to upload..."
# Calculate file hashes # Calculate file hashes
SHA512_HASH=$(sha512sum "$FILE" | awk '{ print $1 }') SHA512_HASH=$(sha512sum "$FILE" | awk '{ print $1 }')
SHA1_HASH=$(sha1sum "$FILE" | awk '{ print $1 }') SHA1_HASH=$(sha1sum "$FILE" | awk '{ print $1 }')
......
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