diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8e37a39..9136ac4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -28,6 +28,11 @@ on: required: true type: boolean default: true + # update_website: + # description: "Update wimods.net post (only works if there already is one and publish_curseforge is true)" + # required: false + # type: boolean + # default: false jobs: publish: @@ -85,4 +90,27 @@ jobs: if: ${{ inputs.publish_curseforge }} run: ./gradlew publishCurseforge --stacktrace -# TODO: Trigger website update + - name: Get CurseForge file ID + id: cf_file_id + if: ${{ inputs.publish_curseforge }} + run: | + file_id=$(./gradlew getCurseforgeId | grep -o 'CURSEFORGE_FILE_ID=[0-9]*' | grep -o '[0-9]*') + echo "file_id=$file_id" >> "$GITHUB_OUTPUT" + echo "CurseForge file ID: `$file_id`" >> $GITHUB_STEP_SUMMARY + + # TODO: The add_mod_port workflow currently only works for Fabric versions. + # - name: Trigger website update + # if: ${{ inputs.update_website && inputs.publish_curseforge }} + # env: + # GH_TOKEN: ${{ secrets.WIMODS_NET_PUBLISH_TOKEN }} + # run: | + # MOD_VERSION=$(grep "mod_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r' | sed 's/-MC.*$//') + # MC_VERSION=$(grep "minecraft_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r') + # FAPI_VERSION=$(grep "fabric_version" gradle.properties | cut -d'=' -f2 | tr -d ' \r') + # gh workflow run add_mod_port.yml \ + # -R Wurst-Imperium/wimods.net \ + # -f mod="chestesp" \ + # -f mod_version="$MOD_VERSION" \ + # -f mc_version="$MC_VERSION" \ + # -f fapi_version="$FAPI_VERSION" \ + # -f file_id="${{ steps.cf_file_id.outputs.file_id }}" diff --git a/build.gradle b/build.gradle index c2e2703..67113f8 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,8 @@ plugins { id "java-library" id "eclipse" id "idea" - id "net.neoforged.gradle.userdev" version "7.0.146" - id "net.neoforged.gradle.mixin" version "7.0.146" + id "net.neoforged.gradle.userdev" version "7.0.171" + id "net.neoforged.gradle.mixin" version "7.0.171" id "me.modmuss50.mod-publish-plugin" version "0.8.1" id "com.diffplug.spotless" version "6.25.0" } @@ -98,7 +98,7 @@ runs { systemProperty 'forge.enabledGameTestNamespaces', project.mod_id } - data { + clientData { // example of overriding the workingDirectory set in configureEach above, uncomment if you want to use it // workingDirectory project.file('run-data') @@ -120,17 +120,8 @@ configurations { configurations.all { resolutionStrategy { - // Override vulnerable msal4j dependency until Minecraft updates to a - // newer version. v1.15.0, used by Minecraft 1.21.3, is vulnerable to - // CVE-2024-35255. - force "com.microsoft.azure:msal4j:1.17.2" - // Override vulnerable netty-common dependency until Minecraft updates - // to a newer version. v4.1.97.Final, used by Minecraft 1.21 - 1.21.3, - // is vulnerable to CVE-2024-47535. - force "io.netty:netty-common:4.1.115.Final" - - // Fixes a weird issue in NeoForge 21.3 where it tries to load both - // ASM 9.7 and ASM 9.5 at the same time. + // Fixes a weird issue in NeoForge 21.3-21.4 where it tries to load + // both ASM 9.7 and ASM 9.5 at the same time. force "org.ow2.asm:asm-analysis:9.7" force "org.ow2.asm:asm:9.7" force "org.ow2.asm:asm-tree:9.7" @@ -178,7 +169,7 @@ dependencies { api("org.yaml:snakeyaml:2.2") { because "version 1.27 pulled from cloth-config has security vulnerabilities" } - api("com.google.code.gson:gson:2.10.1") { + api("com.google.code.gson:gson:2.11.0") { because "version 2.8.1 pulled from cloth-config has security vulnerabilities" } } @@ -222,14 +213,14 @@ tasks.register('runEndToEndTest') { // Modify runClient if it's running as a dependency of runEndToEndTest. // Since NeoGradle doesn't allow custom run types yet, this is the only way to // make runEndToEndTest work for now. -tasks.withType(net.neoforged.gradle.common.runs.tasks.RunExec).configureEach { +tasks.withType(JavaExec).configureEach { doFirst { if (gradle.startParameter.taskNames.contains('runEndToEndTest')) { - jvmArguments.addAll( + jvmArgs += [ '-Dchestesp.e2eTest', '-Dmixin.debug.verify=true', '-Dmixin.debug.countInjections=true' - ) + ] } } } @@ -264,7 +255,7 @@ spotless { } json { target "src/**/*.json" - gson().indentWithSpaces(2).version("2.10.1") + gson().indentWithSpaces(2).version("2.11.0") } } @@ -297,6 +288,16 @@ publishMods { } } +import groovy.json.JsonSlurper + +tasks.register("getCurseforgeId") { + inputs.file publishCurseforge.result + doLast { + def result = new JsonSlurper().parseText(publishCurseforge.result.get().asFile.text) + println "CURSEFORGE_FILE_ID=${result.fileId}" + } +} + tasks.named("publishMods").configure { dependsOn(tasks.named("build")) } @@ -305,6 +306,10 @@ tasks.named("publishCurseforge").configure { dependsOn(tasks.named("build")) } +tasks.named("getCurseforgeId").configure { + dependsOn(tasks.named("publishCurseforge")) +} + import org.kohsuke.github.GHReleaseBuilder import org.kohsuke.github.GitHub diff --git a/gradle.properties b/gradle.properties index e25b12d..8b3a060 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,20 +5,20 @@ org.gradle.debug=false #read more on this at https://github.com/neoforged/ModDevGradle?tab=readme-ov-file#better-minecraft-parameter-names--javadoc-parchment # you can also find the latest versions at: https://parchmentmc.org/docs/getting-started -parchment_minecraft_version=1.21 -parchment_mappings_version=2024.07.28 +parchment_minecraft_version=1.21.4 +parchment_mappings_version=2024.12.07 # Environment Properties # You can find the latest versions here: https://projects.neoforged.net/neoforged/neoforge # The Minecraft version must agree with the Neo version to get a valid artifact -minecraft_version=1.21.3 +minecraft_version=1.21.4 # The Minecraft version range can use any release version of Minecraft as bounds. # Snapshots, pre-releases, and release candidates are not guaranteed to sort properly # as they do not follow standard versioning conventions. -minecraft_version_range=[1.21.2, 1.21.4) +minecraft_version_range=[1.21.4, 1.21.5) # The Neo version must agree with the Minecraft version to get a valid artifact -neo_version=21.3.4-beta +neo_version=21.4.12-beta # The Neo version range can use any version of Neo as bounds -neo_version_range=[21.2.0-beta,) +neo_version_range=[21.4.0-beta,) # The loader version range can only use the major version of FML as bounds loader_version_range=[4,) @@ -32,7 +32,7 @@ mod_name=ChestESP # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPL-3.0-or-later # The mod version. See https://semver.org/ -mod_version=1.2-MC1.21.3-NeoForge +mod_version=1.2-MC1.21.4-NeoForge # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -43,9 +43,9 @@ mod_authors=Alexander01998 mod_description=Highlights nearby chests so you can see them through walls. Based on a Wurst Client feature of the same name. # CurseForge -cf_game_version=1.21.3 +cf_game_version=1.21.4 # Dependencies # check at https://modrinth.com/mod/cloth-config/versions?l=neoforge -cloth_config_version=16.0.141 -cloth_config_version_range=[16.0.0-beta,17.0.0-beta) +cloth_config_version=17.0.142 +cloth_config_version_range=[16.0.0-beta,18.0.0-beta)