Skip to content

Commit 5f89929

Browse files
committed
Make Curseforge release use the same build number as the build itself.
1 parent 9437127 commit 5f89929

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.circleci/config.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ jobs:
9191
TAG_BUILD="$(echo "$CIRCLE_TAG" | sed -E 's/-[0-9.-]+$//' | sed -E 's/(^|-)([^-])/\U\2/g')"
9292
TAG_VERSION="$(echo "$CIRCLE_TAG" | sed -E 's/[^0-9]+//')"
9393
PROJECT_ID="$(jq -r .projectId $TAG_BUILD/curseforge.json)"
94-
METADATA="$(jq -n '{"changelog": $ARGS.positional[0], "changelogType": "markdown", "displayName": $ARGS.positional[1], "gameVersions": [8056, 7498, 4458], "releaseType": "release"}' --args "$DESCRIPTION" "v$TAG_VERSION.$CIRCLE_BUILD_NUM")"
9594
FILE="$(ls /tmp/workspace/libs/*.jar | head -n 1)"
95+
# Use the build number on the JAR to prevent confusion.
96+
ORIGINAL_BUILD_NUM="$(echo "$FILE" | sed -E 's/^.*\.([0-9]+)\.jar$/\1/')"
97+
METADATA="$(jq -n '{"changelog": $ARGS.positional[0], "changelogType": "markdown", "displayName": $ARGS.positional[1], "gameVersions": [8056, 7498, 4458], "releaseType": "release"}' --args "$DESCRIPTION" "v$TAG_VERSION.$ORIGINAL_BUILD_NUM")"
9698
curl -XPOST "https://minecraft.curseforge.com/api/projects/$PROJECT_ID/upload-file" -F "file=@$FILE" -F "metadata=$METADATA" -H "X-Api-Token: $CURSEFORGE_TOKEN"
9799
workflows:
98100
version: 2

0 commit comments

Comments
 (0)