diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/build.gradle b/build.gradle index 67a2a43..1a7ca5e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,9 +1,10 @@ plugins { id 'fabric-loom' version '1.6-SNAPSHOT' id 'me.fallenbreath.yamlang' version '1.3.1' + id 'me.modmuss50.mod-publish-plugin' version '0.5.1' } -version = project.mod_version +version = "${project.mod_version}-dev+mc${project.minecraft_version}" group = project.maven_group base { @@ -96,4 +97,86 @@ jar { from("LICENSE") { rename { "${it}_${project.base.archivesName.get()}"} } -} \ No newline at end of file +} + +publishMods { + file = remapJar.archiveFile + version = project.version + changelog = getRootProject().file("CHANGELOG.md").text + type = STABLE + modLoaders.add("fabric") + + def min = property('publish_target_min') + def max = property('publish_target_max') + + def minecraftVersion = min == max ? min : "${min}-${max}" + displayName = "FlightAssistant ${property('mod_version')} (MC ${minecraftVersion})" + + if (providers.gradleProperty('modrinthToken').present) { + modrinth { + projectId = property('mod_modrinth') + accessToken = providers.gradleProperty('modrinthToken').get() + + if (min == max) { + minecraftVersions.add(min) + } else { + minecraftVersionRange { + start = min + end = max + } + } + + requires { + slug = "fabric-api" + } + requires { + slug = "yacl" + } + optional { + slug = "modmenu" + } + optional { + slug = "immediatelyfast" + } + } + } + + if (providers.gradleProperty('curseforgeToken').present) { + curseforge { + projectId = property('mod_curseforge') + accessToken = providers.gradleProperty('curseforgeToken').get() + + if (min == max) { + minecraftVersions.add(min) + } else { + minecraftVersionRange { + start = min + end = max + } + } + + requires { + slug = "fabric-api" + } + requires { + slug = "yacl" + } + optional { + slug = "modmenu" + } + optional { + slug = "immediatelyfast" + } + } + } + + if (providers.gradleProperty('githubToken').present) { + github { + repository = property('mod_github') + accessToken = providers.gradleProperty('githubToken').get() + + commitish = property('git_branch') + tagName = project.version + } + } +} diff --git a/gradle.properties b/gradle.properties index 3ce4b75..bf3e754 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.20.4+build.3 floader_version=0.15.3 # Mod Properties -mod_version=2.3.0-dev+mc1.20.4 +mod_version=2.3.0 maven_group=ru.octol1ttle.flightassistant archives_base_name=flightassistant @@ -19,4 +19,11 @@ fapi_version=0.96.4 yacl_version=3.3.1 modmenu_version=9.0.0 immediatelyfast_version=1.2.8 -dabr_version=3.3.8 \ No newline at end of file +dabr_version=3.3.8 +# Publish Properties +publish_target_min=1.20 +publish_target_max=1.20.4 +mod_modrinth=CWqLEOPt +mod_curseforge=972881 +mod_github=Octol1ttle/FlightAssistant +git_branch=dev