From 8eb81f7cf3312ae0d0774c7041b6f5512a18e05a Mon Sep 17 00:00:00 2001 From: TeamDman Date: Fri, 19 Apr 2024 21:32:29 -0400 Subject: [PATCH 1/3] jar collection action improvements --- actions/Collect jars.ps1 | 29 ++++++++++++++++++++++++----- actions/Wipe jars summary dir.ps1 | 5 +++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 actions/Wipe jars summary dir.ps1 diff --git a/actions/Collect jars.ps1 b/actions/Collect jars.ps1 index bc8750540..ce4586eab 100644 --- a/actions/Collect jars.ps1 +++ b/actions/Collect jars.ps1 @@ -3,8 +3,8 @@ try { # Get to repos folder $cwd = Get-Location $expected = "D:\repos\Minecraft\SFM\repos" - if (-not $cwd -eq $expected) { - Write-Host $cwd + if (-not $cwd.Path -eq $expected) { + Write-Host $cwd.Path throw "This should be ran from a directory that is a child of D:\repos\Minecraft\SFM" } @@ -12,11 +12,30 @@ try { Write-Host "Collecting jars" $outdir = "..\jars" New-Item -ItemType Directory -Path $outdir -ErrorAction SilentlyContinue + + # Fetch all jar files in the build/libs directories $jars = Get-ChildItem -Recurse | Where-Object { $_ -like "*build\libs\*.jar" } - $jars | ForEach-Object { - Copy-Item -Path $_.FullName -Destination $outdir + + # Sort and filter jars by semantic version + $sortedJars = $jars | ForEach-Object { + $nameParts = $_.Name -split '-' + [PSCustomObject]@{ + FullPath = $_.FullName + Major = $nameParts[1] + Minor = [int]($nameParts[2].Split('.')[1]) + Patch = $nameParts[3] + } + } | Sort-Object -Property Major, Minor -Descending | Group-Object -Property Major | ForEach-Object { + $_.Group | Sort-Object -Property Minor, Patch -Descending | Select-Object -First 1 } + + # Copy selected jars to the output directory + $sortedJars | ForEach-Object { + Copy-Item -Path $_.FullPath -Destination $outdir + } + + # Open output directory Invoke-Item $outdir } finally { Pop-Location -} \ No newline at end of file +} diff --git a/actions/Wipe jars summary dir.ps1 b/actions/Wipe jars summary dir.ps1 new file mode 100644 index 000000000..54c487662 --- /dev/null +++ b/actions/Wipe jars summary dir.ps1 @@ -0,0 +1,5 @@ +Get-ChildItem -File ..\..\jars ` +| ForEach-Object { + Write-Host "Removing $_" + $_ | Remove-Item +} \ No newline at end of file From 189aea4881120c0beafb547963a79201f24fd98d Mon Sep 17 00:00:00 2001 From: TeamDman Date: Fri, 19 Apr 2024 21:32:50 -0400 Subject: [PATCH 2/3] update release process and update changelog --- README.md | 76 +++++++++++-------- .../sfm/template_programs/changelog.sfml | 1 + 2 files changed, 46 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 836e4b919..51b773711 100644 --- a/README.md +++ b/README.md @@ -35,37 +35,51 @@ for syntax highlighting 🌈 The following process is designed to catch the most obvious problems that may arise from creating a new release. -``` -versions = [1.19.2, 1.19.4, 1.20, 1.20.1] -jars = [] -for i,version in enumerate(versions): - git checkout $version - gradle genIntellijRuns - if i == 0: - make changes - bump mod_version in gradle.properties - update changelog.sfml example - git commit - git push - else: - git merge $versions[i-1] - resolve conflicts - runData - git add src/generated - rm -rf runGameTest/world - gradle runGameTestServer, assert exit == 0 - gradle build | jars.append($_) - -git push --all - -for jar in jars: - copy jar to server, run.bat - copy jar to prism launcher, launch - connect to server - assemble a simple program, assert works - -for jar in jars: - upload jar to curseforge with changelog +```pwsh +.\act.ps1 +Manual: Bump `mod_version` in gradle.properties +Manual: Commit bump +Action: Propagate changes +Action: Run gameTestServer for all versions +Action: Build +Action: Wipe jars summary dir +Action: Collect jars +Action: Update PrismMC test instances to use latest build output +Action: Update test servers to latest build output +Action: Launch PrismMC +Action: Launch test server + +for each version: + Launch version from PrismMC + Multiplayer -> join localhost + Break previous setup + Build new setup from scratch -- ensure core gameplay loop is always tested + Validate changelog accuracy + /stop + Quit game + +For each version: + CurseForge -> Upload file +"https://authors.curseforge.com/#/projects/306935/files/create" + Environment=Server+Client + Modloader=match mc version { + ..1.20 -> Forge + 1.20.1 -> Forge+NeoForge + 1.20.2.. -> NeoForge + } + Java=Java 17 + Minecraft=$version + Changelog= << + ``` + $section from changelog.sfml + ``` + >> + +For each version: + Modrinth -> Versions -> Drag n drop +"https://modrinth.com/mod/super-factory-manager/versions" + Adjust populated version numbers + Changelog=same as above ``` ## Optimization diff --git a/src/main/resources/assets/sfm/template_programs/changelog.sfml b/src/main/resources/assets/sfm/template_programs/changelog.sfml index c21a908db..248bf2f35 100644 --- a/src/main/resources/assets/sfm/template_programs/changelog.sfml +++ b/src/main/resources/assets/sfm/template_programs/changelog.sfml @@ -4,6 +4,7 @@ NAME "Changelog for 4.15.1" ---- 4.15.1 --- -- Fix crash bug where variable-size inventories (composters) crashed +-- Fix modloader=forge missing for the mc=1.20.1 CurseForge uploads ---- 4.15.0 ---- -- alias "each" to "every" when parsing set operators From d31cb89a730d776f787cf6189678209c27189e9f Mon Sep 17 00:00:00 2001 From: TeamDman Date: Fri, 19 Apr 2024 21:36:54 -0400 Subject: [PATCH 3/3] -- fix missing dash in changelog -- make FORGET keyword blue -- Add git tag action to release process documentation --- README.md | 3 +++ .../sfm/client/ProgramSyntaxHighlightingHelper.java | 2 +- .../resources/assets/sfm/template_programs/changelog.sfml | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 51b773711..525fc89e6 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,9 @@ For each version: "https://modrinth.com/mod/super-factory-manager/versions" Adjust populated version numbers Changelog=same as above + +Action: Tag +Action: Push all ``` ## Optimization diff --git a/src/main/java/ca/teamdman/sfm/client/ProgramSyntaxHighlightingHelper.java b/src/main/java/ca/teamdman/sfm/client/ProgramSyntaxHighlightingHelper.java index 1a7c415e4..b28a46071 100644 --- a/src/main/java/ca/teamdman/sfm/client/ProgramSyntaxHighlightingHelper.java +++ b/src/main/java/ca/teamdman/sfm/client/ProgramSyntaxHighlightingHelper.java @@ -88,7 +88,6 @@ private static ChatFormatting getColour(Token token) { case SFMLLexer.FROM: case SFMLLexer.TO: case SFMLLexer.OUTPUT: - case SFMLLexer.FORGET: return ChatFormatting.LIGHT_PURPLE; case SFMLLexer.NAME: case SFMLLexer.EVERY: @@ -101,6 +100,7 @@ private static ChatFormatting getColour(Token token) { case SFMLLexer.TRUE: case SFMLLexer.FALSE: case SFMLLexer.NOT: + case SFMLLexer.FORGET: return ChatFormatting.BLUE; case SFMLLexer.IDENTIFIER: case SFMLLexer.STRING: diff --git a/src/main/resources/assets/sfm/template_programs/changelog.sfml b/src/main/resources/assets/sfm/template_programs/changelog.sfml index 248bf2f35..bc368414e 100644 --- a/src/main/resources/assets/sfm/template_programs/changelog.sfml +++ b/src/main/resources/assets/sfm/template_programs/changelog.sfml @@ -1,8 +1,13 @@ -- Official SFM Discord: -- https://discord.gg/5mbUY3mu6m +---- next ---- +-- fix missing dash in changelog +-- make FORGET keyword blue +-- Add git tag action to release process documentation + NAME "Changelog for 4.15.1" ----- 4.15.1 --- +---- 4.15.1 ---- -- Fix crash bug where variable-size inventories (composters) crashed -- Fix modloader=forge missing for the mc=1.20.1 CurseForge uploads