From 4adb756b3673f5776caa7624a274bbda4ea67b03 Mon Sep 17 00:00:00 2001 From: Provismet <17149901+Provismet@users.noreply.github.com> Date: Sun, 15 Sep 2024 14:09:08 +0100 Subject: [PATCH] Add publishing plugin. --- build.gradle | 45 ++++++++++++++++++++++++++++++++++++++++++++- changelog.md | 5 +++++ gradle.properties | 14 +++++++++++--- 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 changelog.md diff --git a/build.gradle b/build.gradle index c6806d1..f57e390 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { - id 'fabric-loom' version '1.4-SNAPSHOT' + id 'fabric-loom' version '1.7-SNAPSHOT' id 'maven-publish' + id "me.modmuss50.mod-publish-plugin" version "0.6.3" } version = project.mod_version + "+" + project.minecraft_version @@ -62,10 +63,52 @@ jar { } } +publishMods { + file = remapJar.archiveFile + additionalFiles.from(remapSourcesJar.archiveFile) + changelog = file("changelog.md").text + type = STABLE + modLoaders.add("fabric") + modLoaders.add("quilt") + displayName = project.version.toString() + dryRun = providers.environmentVariable("GITHUB_TOKEN").getOrNull() == null || providers.environmentVariable("MODRINTH_TOKEN").getOrNull() == null || providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null + + github { + repository = "Provismet/${project.github_repo}" + accessToken = providers.environmentVariable("GITHUB_TOKEN") + commitish = "${project.github_branch}" + tagName = "${project.mod_version}-mc${project.minecraft_version}" + allowEmptyFiles = true + displayName = "${project.mod_version} - ${project.minecraft_version}" + } + + modrinth { + projectId = project.modrinth_id + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + minecraftVersionRange { + start = project.version_start + end = project.version_end + } + requires("fabric-api") + } + + curseforge { + projectId = project.curseforge_id + accessToken = providers.environmentVariable("CURSEFORGE_TOKEN") + clientRequired = true + minecraftVersionRange { + start = project.version_start + end = project.version_end + } + requires("fabric-api") + } +} + // configure the maven publication publishing { publications { mavenJava(MavenPublication) { + version = project.mod_version + "-mc" + project.minecraft_version from components.java } } diff --git a/changelog.md b/changelog.md new file mode 100644 index 0000000..12098f1 --- /dev/null +++ b/changelog.md @@ -0,0 +1,5 @@ +Minor patch to enable a fix for a niche compatibility issue in Dual Swords. + +## Additions +- Melee weapons now have a stack-aware version of `getWeaponDamage`. +- Dual weapons now have a stack-aware version of `getOffhandDamage`. \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index f86e439..6ba9012 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,11 +9,19 @@ yarn_mappings=1.20.1+build.10 loader_version=0.15.2 # Mod Properties -mod_version=1.0.0 -maven_group=com.provismet +mod_version=1.1.0 +maven_group=com.github.Provismet archives_base_name=combatplus-core # Dependencies fabric_version=0.91.0+1.20.1 fabric_asm_version=v2.3 -lilylib_version=1.1.3-mc1.20 \ No newline at end of file +lilylib_version=1.1.3-mc1.20 + +# Publishing +github_repo = CombatPlus-Core +github_branch = 1.20 +modrinth_id = NbKFMiE7 +curseforge_id = 973671 +version_start = 1.20 +version_end = 1.20.2 \ No newline at end of file