Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
CreatureChat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Public
CreatureChat
Commits
8b206ef8
Commit
8b206ef8
authored
Jul 03, 2024
by
Jonathan Thomas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Investigating curseforge deploy issue #1
parent
8b632382
Pipeline
#12566
passed with stages
in 2 minutes 33 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
41 deletions
+8
-41
.gitlab-ci.yml
.gitlab-ci.yml
+1
-1
deploy-curseforge.sh
deploy-curseforge.sh
+7
-40
No files found.
.gitlab-ci.yml
View file @
8b206ef8
...
...
@@ -126,6 +126,6 @@ CurseForge:
-
chmod +x ./deploy-curseforge.sh
-
./deploy-curseforge.sh
only
:
-
develop
-
fix-curseforge
tags
:
-
minecraft
deploy-curseforge.sh
View file @
8b206ef8
...
...
@@ -49,11 +49,17 @@ echo ""
# Iterate over each jar file in the artifacts
for
FILE
in
creaturechat
*
.jar
;
do
if
[
-f
"
$FILE
"
]
;
then
echo
"FILE:
$FILE
"
FILE_BASENAME
=
$(
basename
"
$FILE
"
)
OUR_VERSION
=
$(
echo
"
$FILE_BASENAME
"
| sed
-n
's/creaturechat-\(.*\)+.*\.jar/\1/p'
)
MINECRAFT_VERSION
=
$(
echo
"
$FILE_BASENAME
"
| sed
-n
's/.*+\(.*\)\.jar/\1/p'
)
VERSION_NUMBER
=
"
$OUR_VERSION
-
$MINECRAFT_VERSION
"
echo
"loop: FILE_BASENAME:
$FILE_BASENAME
"
echo
"loop: OUR_VERSION:
$OUR_VERSION
"
echo
"loop: MINECRAFT_VERSION:
$MINECRAFT_VERSION
"
echo
"loop: VERSION_NUMBER:
$VERSION_NUMBER
"
# Verify that OUR_VERSION and MINECRAFT_VERSION are not empty and OUR_VERSION matches VERSION
if
[
-z
"
$OUR_VERSION
"
]
||
[
-z
"
$MINECRAFT_VERSION
"
]
||
[
"
$OUR_VERSION
"
!=
"
$VERSION
"
]
;
then
echo
"ERROR: Version mismatch or missing version information in
$FILE_BASENAME
. OUR_VERSION:
$OUR_VERSION
, MINECRAFT_VERSION:
$MINECRAFT_VERSION
, EXPECTED VERSION:
$VERSION
"
...
...
@@ -64,46 +70,7 @@ for FILE in creaturechat*.jar; do
# Fetch game version IDs
GAME_VERSION_IDS
=(
$(
fetch_game_version_ids
"
$MINECRAFT_VERSION
"
)
)
echo
"GAME_VERSION_IDS:
$GAME_VERSION_IDS
"
# Create a new version payload
PAYLOAD
=
$(
jq
-n
--arg
changelog
"
$CHANGELOG
"
\
--arg
changelogType
"markdown"
\
--arg
displayName
"
$FILE_BASENAME
"
\
--argjson
gameVersions
"
$(
printf
'%s\n'
"
${
GAME_VERSION_IDS
[@]
}
"
| jq
-R
.
| jq
-s
.
)
"
\
--argjson
gameVersionTypeIds
'[75125]'
\
--arg
releaseType
"release"
\
--argjson
relations
'[{"slug": "'
"
$DEPENDENCY_SLUG
"
'", "type": "requiredDependency"}]'
\
'{
"changelog": $changelog,
"changelogType": $changelogType,
"displayName": $displayName,
"gameVersions": $gameVersions | map(tonumber),
"gameVersionTypeIds": $gameVersionTypeIds,
"releaseType": $releaseType,
"relations": {
"projects": $relations
}
}'
)
# Write the payload to a temporary file to avoid issues with large payloads
echo
"
$PAYLOAD
"
>
metadata.json
# Sleep for the specified duration
sleep
$SLEEP_DURATION
# Upload the version with the file
echo
"Uploading
$FILE_BASENAME
as version
$VERSION_NUMBER
..."
HTTP_RESPONSE
=
$(
curl
--retry
3
--retry-delay
5
--fail
-o
response.txt
-w
"
\n
HTTP Code: %{http_code}
\n
"
-X
POST
"
$API_URL
/projects/
$PROJECT_ID
/upload-file"
\
-H
"X-Api-Token:
$CURSEFORGE_API_KEY
"
\
-H
"User-Agent:
$USER_AGENT
"
\
-F
"metadata=<metadata.json;type=application/json"
\
-F
"file=@
$FILE
;type=application/java-archive"
)
# Output the response and HTTP code
echo
"Response:"
cat
response.txt
echo
"
$HTTP_RESPONSE
"
echo
"Uploaded
$FILE_BASENAME
as version
$VERSION_NUMBER
."
fi
done
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment