Skip to content

Commit

Permalink
Added SERVER_FILE_DISPLAY_NAME setting. Improved on the structure and…
Browse files Browse the repository at this point in the history
… look of the settings file a bit.
  • Loading branch information
NielsPilgaard committed Dec 11, 2018
1 parent 90c8aad commit a0e6a82
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ModpackUploadTool.zip
6 changes: 3 additions & 3 deletions ModpackUploadTool.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ ECHO Making manifest...
twitch_export-win.exe -d "%cd%" -n "%CLIENT_FILENAME%" -p "%MODPACK_VERSION%" -c "%cd%/.build.json" -ct "%CURSEFORGE_TOKEN%"

ECHO Setting up metadata for uploading...
SET CLIENT_METADATA="{'changelog': '%CLIENT_CHANGELOG%','changelogType': '%CLIENT_CHANGELOG_TYPE%','displayName': '%FILE_DISPLAY_NAME%','gameVersions': %GAME_VERSIONS%,'releaseType': '%CLIENT_RELEASE_TYPE%'}"
SET CLIENT_METADATA="{'changelog': '%CLIENT_CHANGELOG%','changelogType': '%CLIENT_CHANGELOG_TYPE%','displayName': '%CLIENT_FILE_DISPLAY_NAME%','gameVersions': %GAME_VERSIONS%,'releaseType': '%CLIENT_RELEASE_TYPE%'}"
ECHO Uploading Modpack to https://minecraft.curseforge.com/api/projects/%CURSEFORGE_PROJECT_ID%/upload-file
curl --user %USER%:%CURSEFORGE_TOKEN% -H "Accept: application/json" -H X-Api-Token:%CURSEFORGE_TOKEN% -F metadata=%CLIENT_METADATA% -F file=@%CLIENT_FILENAME%-%MODPACK_VERSION%.zip https://minecraft.curseforge.com/api/projects/%CURSEFORGE_PROJECT_ID%/upload-file >> ModpackFileId.json

Expand All @@ -20,15 +20,15 @@ SET FILE_ID=%FILE_ID:{"id":=%
SET FILE_ID=%FILE_ID:}=%
CALL :TRIM %FILE_ID% FILE_ID
ECHO ID Returned: %FILE_ID%
del ModpackFileId.json
DEL ModpackFileId.json

:: Create server files
ECHO Making server files...
7z a -tzip %SERVER_FILENAME%-%MODPACK_VERSION%.zip %CONTENTS_TO_ZIP%

:: Uploading Server Files...
ECHO Setting up metadata for uploading...
SET SERVER_METADATA="{'changelog': '%SERVER_CHANGELOG%','changelogType': '%SERVER_CHANGELOG_TYPE%','displayName': '%FILE_DISPLAY_NAME%','parentFileId': %FILE_ID%,'releaseType': '%SERVER_RELEASE_TYPE%'}"
SET SERVER_METADATA="{'changelog': '%SERVER_CHANGELOG%','changelogType': '%SERVER_CHANGELOG_TYPE%','displayName': '%SERVER_FILE_DISPLAY_NAME%','parentFileId': %FILE_ID%,'releaseType': '%SERVER_RELEASE_TYPE%'}"
ECHO Uploading Modpack to https://minecraft.curseforge.com/api/projects/%CURSEFORGE_PROJECT_ID%/upload-file
curl --user %USER%:%CURSEFORGE_TOKEN% -H "Accept: application/json" -H X-Api-Token:%CURSEFORGE_TOKEN% -F metadata=%SERVER_METADATA% -F file=@%SERVER_FILENAME%-%MODPACK_VERSION%.zip https://minecraft.curseforge.com/api/projects/%CURSEFORGE_PROJECT_ID%/upload-file >> ModpackFileId.json

Expand Down
46 changes: 33 additions & 13 deletions modpack_upload_settings.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,45 +2,65 @@
;For more details/help see: https://github.com/NillerMedDild/ModpackUploadTool

;Curseforge authentication
USER=MyUser;
USER=MyUserName;

;Get a Curseforge Token here: https://authors.curseforge.com/account/api-tokens
CURSEFORGE_TOKEN=;

;Modpack
;//=====================================================================//;
; MODPACK & CLIENT FILE SETTINGS
;//=====================================================================//;

;ProjectID can be found on the modpack's Curseforge Projects page, under "About This Project"
CURSEFORGE_PROJECT_ID=999999;
FILE_DISPLAY_NAME=MyModpack-1.0.0;

;The name that is displayed on Curseforge
CLIENT_FILE_DISPLAY_NAME=MyModpack-1.0.0;

;The modpack version will be appended to client and server files.
MODPACK_VERSION=1.0.0;

;FILENAME does not accept whitespaces or special characters.
CLIENT_FILENAME=MyModpack;

;An array of compatible game versions of Minecraft. Do not remove the brackets.
;You can get the list of all gameVersions by using the GetGameVersions script,
;or by issuing a GET request to https://minecraft.curseforge.com/api/game/versions
;The output of GetGameVersions is saved to GameVersions.json
;6756 is Minecraft 1.12.2
GAME_VERSIONS=[6756];

FORGE_VERSION=14.23.5.2768;

;Client File Changelog
;Can be either markdown, text or html
CLIENT_CHANGELOG_TYPE=markdown
CLIENT_CHANGELOG_TYPE=html

CLIENT_CHANGELOG=Empty;
;Leave this blank if you're using the above changelog option (NYI).
CLIENT_CHANGELOG_FILENAME=;

CLIENT_RELEASE_TYPE=alpha;

;Options for Server Files. Setting ENABLE_SERVER_FILE_UPLOAD to true
;will upload Server Files to the original upload's additional files section.
;WIP, cannot be disabled!
;//=====================================================================//;
; SERVER FILE SETTINGS
;//=====================================================================//;

;Will upload Server Files to the original upload's additional files section.
;Cannot be disabled at the moment!
ENABLE_SERVER_FILE_UPLOAD=true;

;The name that is displayed on Curseforge
SERVER_FILE_DISPLAY_NAME=MyModpackServer-1.0.0

;FILENAME does not accept whitespaces or special characters.
SERVER_FILENAME=MyModpack;
SERVER_FILENAME=MyModpackServer;

;A continuous line of the folders and files (with extensions) to zip into Server Files.
CONTENTS_TO_ZIP=mods config;

;Server File Changelog
SERVER_CHANGELOG_TYPE=markdown
SERVER_CHANGELOG_TYPE=html

SERVER_CHANGELOG=Empty;
;Leave this blank if you're using the above changelog option (NYI).
SERVER_CHANGELOG_FILENAME=;

SERVER_RELEASE_TYPE=alpha;

0 comments on commit a0e6a82

Please sign in to comment.