From 58b8cc293d5a9a663ccf433e5bc3d5887922fcbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Pilgaard=20Gr=C3=B8ndahl?= Date: Sun, 14 Aug 2022 20:05:41 +0200 Subject: [PATCH 1/2] Updated to latest ModlistCreator, adding changelog generation Version 4.0.x of ModlistCreator allows us to generate changelogs \o/ I've replaced the RandomLabs changelog generator with the ModlistCreator version. --- modpack-uploader.ps1 | 51 ++++++++++++++++++-------------------------- settings.ps1 | 4 ++-- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/modpack-uploader.ps1 b/modpack-uploader.ps1 index 06a6b2d..026889b 100644 --- a/modpack-uploader.ps1 +++ b/modpack-uploader.ps1 @@ -187,24 +187,19 @@ function New-Changelog { ) { if (-not (Test-Path $CHANGELOG_GENERATOR_JAR) -or $ENABLE_ALWAYS_UPDATE_JARS) { Remove-Item $CHANGELOG_GENERATOR_JAR -Recurse -Force -ErrorAction SilentlyContinue - Get-GitHubRelease -repo "TheRandomLabs/ChangelogGenerator" -file $CHANGELOG_GENERATOR_JAR + Get-GitHubRelease -repo "ModdingX/ModListCreator" -file $CHANGELOG_GENERATOR_JAR } - $changelogFile = "changelog.md" - Remove-Item $changelogFile -ErrorAction SilentlyContinue - Write-Host Write-Host "Generating mod changelog..." -ForegroundColor Cyan Write-Host - java -jar $CHANGELOG_GENERATOR_JAR ` - --markdown ` - --lines=50 ` - --entries=1 ` - --new="$CLIENT_ZIP_NAME.zip" ` - --old="$LAST_MODPACK_ZIP_NAME.zip" - Remove-Item $CHANGELOG_PATH -ErrorAction SilentlyContinue - Move-Item -Path $changelogFile -Destination $CHANGELOG_PATH + + java -jar $CHANGELOG_GENERATOR_JAR ` + changelog ` + --output $CHANGELOG_PATH ` + --new "$CLIENT_ZIP_NAME.zip" ` + --old "$LAST_MODPACK_ZIP_NAME.zip" Write-Host "Mod changelog generated!" -ForegroundColor Green } @@ -217,8 +212,8 @@ function Push-ClientFiles { Remove-BlacklistedFiles } - #$CLIENT_CHANGELOG = Get-Content -Path "$PSScriptRoot/../changelogs/changelog.md" - + # This ugly json seems to be a necessity, + # I have yet to get @{} and ConvertTo-Json to work with the CurseForge Upload API $CLIENT_METADATA = "{ changelog: `'$CLIENT_CHANGELOG`', @@ -253,16 +248,15 @@ function Push-ClientFiles { Write-Host "Failed to upload client files: $response" -ForegroundColor Red throw "Failed to upload client files: $response" } - else { - Write-Host - Write-Host "Uploaded modpack!" -ForegroundColor Green - Write-Host - Write-Host "Return Id: $clientFileReturnId" -ForegroundColor Cyan - Write-Host - - if ($ENABLE_SERVERSTARTER_MODULE) { - Update-FileLinkInServerFiles -ClientFileReturnId $clientFileReturnId - } + + Write-Host + Write-Host "Uploaded modpack!" -ForegroundColor Green + Write-Host + Write-Host "Return Id: $clientFileReturnId" -ForegroundColor Cyan + Write-Host + + if ($ENABLE_SERVERSTARTER_MODULE) { + Update-FileLinkInServerFiles -ClientFileReturnId $clientFileReturnId } } } @@ -380,15 +374,12 @@ function Update-Modlist { if ($ENABLE_MODLIST_CREATOR_MODULE) { if (-not (Test-Path $MODLIST_CREATOR_JAR) -or $ENABLE_ALWAYS_UPDATE_JARS) { Remove-Item $MODLIST_CREATOR_JAR -Recurse -Force -ErrorAction SilentlyContinue - Get-GitHubRelease -repo "MelanX/ModListCreator" -file $MODLIST_CREATOR_JAR + Get-GitHubRelease -repo "ModdingX/ModListCreator" -file $MODLIST_CREATOR_JAR } Remove-Item $MODLIST_PATH -ErrorAction SilentlyContinue - java -jar $MODLIST_CREATOR_JAR --markdown --output "./" --detailed --manifest "$CLIENT_ZIP_NAME.zip" - Copy-Item -Path "MODLIST.md" -Destination $MODLIST_PATH -ErrorAction SilentlyContinue - Move-Item -Path "MODLIST.md" -Destination "MODLIST.md" -ErrorAction SilentlyContinue -Force - Copy-Item -Path "automation/MODLIST.md" -Destination $MODLIST_PATH -ErrorAction SilentlyContinue - Move-Item -Path "automation/MODLIST.md" -Destination "MODLIST.md" -ErrorAction SilentlyContinue -Force + java -jar $MODLIST_CREATOR_JAR modlist --output $MODLIST_PATH --detailed "$CLIENT_ZIP_NAME.zip" + Copy-Item -Path $MODLIST_PATH -Destination "$INSTANCE_ROOT/MODLIST.md" } } diff --git a/settings.ps1 b/settings.ps1 index 55d10d9..9998abb 100644 --- a/settings.ps1 +++ b/settings.ps1 @@ -72,10 +72,10 @@ $CLIENT_RELEASE_TYPE = "beta" #=====================================================================// # File name of the latest https://github.com/TheRandomLabs/ChangelogGenerator/releases -$CHANGELOG_GENERATOR_JAR = "ChangelogGenerator-2.0.0-pre10.jar" +$CHANGELOG_GENERATOR_JAR = "ModListCreator-4.0.0-fatjar.jar" # File name of the latest https://github.com/MelanX/ModListCreator/releases -$MODLIST_CREATOR_JAR = "ModListCreator-2.0.1.jar" +$MODLIST_CREATOR_JAR = "ModListCreator-4.0.0-fatjar.jar" #=====================================================================// # CLIENT FILE SETTINGS From 8538bcfe85d6df8df7ac63f0b71e8f7e582840f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Pilgaard=20Gr=C3=B8ndahl?= Date: Sun, 14 Aug 2022 21:36:02 +0200 Subject: [PATCH 2/2] Update settings.ps1 --- settings.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/settings.ps1 b/settings.ps1 index 9998abb..d22026a 100644 --- a/settings.ps1 +++ b/settings.ps1 @@ -71,11 +71,11 @@ $CLIENT_RELEASE_TYPE = "beta" # DEPENDENCIES #=====================================================================// -# File name of the latest https://github.com/TheRandomLabs/ChangelogGenerator/releases -$CHANGELOG_GENERATOR_JAR = "ModListCreator-4.0.0-fatjar.jar" +# File name of the latest https://github.com/ModdingX/ModListCreator/releases +$CHANGELOG_GENERATOR_JAR = "ModListCreator-4.0.1-fatjar.jar" -# File name of the latest https://github.com/MelanX/ModListCreator/releases -$MODLIST_CREATOR_JAR = "ModListCreator-4.0.0-fatjar.jar" +# File name of the latest https://github.com/ModdingX/ModListCreator/releases +$MODLIST_CREATOR_JAR = "ModListCreator-4.0.1-fatjar.jar" #=====================================================================// # CLIENT FILE SETTINGS