diff --git a/.github/workflows/build-release.yml b/.github/workflows/build-release.yml index 6efc226..6c38950 100644 --- a/.github/workflows/build-release.yml +++ b/.github/workflows/build-release.yml @@ -3,13 +3,18 @@ name: Build & Release on: push: tags: - - 'v*' + - "v*" jobs: build: if: | !contains(github.event.head_commit.message, '[ciskip]') - uses: nanite/workflows/.github/workflows/standard-arch-release.yml@v1 + uses: nanite/workflows/.github/workflows/standard-modmuss.yml@v1.1 + with: + java-version: 17 + changelog-file: "./CHANGELOG.md" + release-to-github: false secrets: nanite-token: ${{ secrets.NANITE_DEPLOY }} curse-token: ${{ secrets.CURSE_DEPLOY }} + modrinth-token: ${{ secrets.MODRINTH_TOKEN }} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f47b94..2060427 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,3 @@ -## 2.3.9 +## 77.0.0 -### Fixed - -- An issue causing the kill commands to not always kill all the entities and throw an error message instead. +- Mod has been rewritten and new commands had been added \ No newline at end of file diff --git a/build.gradle b/build.gradle index 4fb6a41..ec39c12 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,7 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.1-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false + id "me.modmuss50.mod-publish-plugin" version "0.4.5" } architectury { @@ -9,6 +10,7 @@ architectury { subprojects { apply plugin: "dev.architectury.loom" + apply plugin: "maven-publish" loom { silentMojangMappingsLicense() @@ -16,10 +18,21 @@ subprojects { dependencies { minecraft "com.mojang:minecraft:${rootProject.minecraft_version}" - // The following line declares the mojmap mappings, you may use other mappings as well mappings loom.officialMojangMappings() - // The following line declares the yarn mappings you may select this one as well. - // mappings "net.fabricmc:yarn:1.19.2+build.28:v2" + } + + publishing { + repositories { + if (providers.environmentVariable("NANITE_TOKEN").isPresent()) { + maven { + url "https://maven.nanite.dev/releases" + credentials { + username = "nanite" + password = providers.environmentVariable("NANITE_TOKEN").get() + } + } + } + } } } @@ -28,10 +41,9 @@ allprojects { apply plugin: "architectury-plugin" apply plugin: "maven-publish" - ext.ENV = System.getenv() archivesBaseName = rootProject.archives_base_name - version = "${rootProject.mod_version}-build.${ENV.GITHUB_RUN_NUMBER ?: 9999}+mc${rootProject.minecraft_version}" + version = rootProject.mod_version group = rootProject.maven_group repositories { @@ -48,4 +60,57 @@ allprojects { } } -task curseforgePublish +publishMods { + dryRun = providers.environmentVariable("CURSE_TOKEN").getOrNull() == null + changelog = file("./CHANGELOG.md").text + version = "${mod_version}" + type = STABLE + + def fabricOptions = publishOptions { + file = project.provider { project(":fabric").tasks.remapJar }.flatMap { it.archiveFile } + displayName = "[FABRIC][${minecraft_version}] ${project.name} ${mod_version}" + modLoaders.add("fabric") + } + + def forgeOptions = publishOptions { + file = project.provider { project(":forge").tasks.remapJar }.flatMap { it.archiveFile } + displayName = "[FORGE][${minecraft_version}] ${project.name} ${mod_version}" + modLoaders.add("forge") + } + + def curseForgeOptions = curseforgeOptions { + accessToken = providers.environmentVariable("CURSE_TOKEN") + projectId = "${curseforge_id}" + minecraftVersions.add("${minecraft_version}") + } + + def modrinthOptions = modrinthOptions { + accessToken = providers.environmentVariable("MODRINTH_TOKEN") + projectId = "${modrinth_id}" + minecraftVersions.add("${minecraft_version}") + } + + curseforge("curseforgeFabric") { + from(curseForgeOptions, fabricOptions) + requires { + slug = "fabric-api" + } + } + + curseforge("curseforgeForge") { + from(curseForgeOptions, forgeOptions) + } + + if (providers.environmentVariable("MODRINTH_TOKEN").getOrNull() != null) { + modrinth("modrinthFabric") { + from(modrinthOptions, fabricOptions) + requires { + slug = "fabric-api" + } + } + + modrinth("modrinthForge") { + from(modrinthOptions, forgeOptions) + } + } +} diff --git a/common/build.gradle b/common/build.gradle index 8c4bc57..43122b5 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -17,20 +17,8 @@ dependencies { publishing { publications { mavenCommon(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name + artifactId = "${rootProject.archivesBaseName}-${project.name}" from components.java } } - - repositories { - if (ENV.NANITE_TOKEN) { - maven { - url "https://maven.nanite.dev/releases" - credentials { - username = "nanite" - password = "${ENV.NANITE_TOKEN}" - } - } - } - } } diff --git a/fabric/build.gradle b/fabric/build.gradle index c10b72a..fef2cba 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -1,6 +1,5 @@ plugins { id "com.github.johnrengelman.shadow" version "7.1.2" - id "com.matthewprenger.cursegradle" version "1.4.0" } architectury { @@ -63,7 +62,7 @@ remapJar { input.set shadowJar.archiveFile dependsOn shadowJar setArchiveClassifier(null) - setArchivesBaseName("${rootProject.archivesBaseName}-${project.name}") + setArchivesBaseName("${rootProject.archives_base_name}-${project.name}") } jar { @@ -85,42 +84,8 @@ components.java { publishing { publications { mavenFabric(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name + artifactId = "${rootProject.archivesBaseName}-${project.name}" from components.java } } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - if (ENV.NANITE_TOKEN) { - maven { - url "https://maven.nanite.dev/releases" - credentials { - username = "nanite" - password = "${ENV.NANITE_TOKEN}" - } - } - } - } -} - -if (ENV.CURSE_TOKEN) { - curseforge { - apiKey = ENV.CURSE_TOKEN - project { - id = project.curseforge_id - releaseType = "beta" - addGameVersion "Fabric" - addGameVersion "${minecraft_version}" - mainArtifact(remapJar.archiveFile) - relations { - requiredDependency("architectury-api") - } - changelog = file("../CHANGELOG.md") - changelogType = 'markdown' - } - } -} - - -rootProject.tasks.curseforgePublish.dependsOn tasks.curseforge +} \ No newline at end of file diff --git a/forge/build.gradle b/forge/build.gradle index 4c471e0..6e379fd 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -1,6 +1,5 @@ plugins { id "com.github.johnrengelman.shadow" version "7.1.2" - id "com.matthewprenger.cursegradle" version "1.4.0" } architectury { @@ -37,7 +36,7 @@ configurations { } dependencies { - forge "net.minecraftforge:forge:${rootProject.forge_version}" + forge "net.minecraftforge:forge:${rootProject.minecraft_version}-${rootProject.forge_version}" modApi "dev.architectury:architectury-forge:${rootProject.architectury_version}" common(project(path: ":common", configuration: "namedElements")) { transitive false } @@ -47,8 +46,7 @@ dependencies { processResources { inputs.property "version", project.version - def forgeVersion = ((String) rootProject.forge_version).split("-").last() - def forgeBase = forgeVersion.split("\\.").first() + def forgeVersion = rootProject.forge_version filesMatching("META-INF/mods.toml") { expand "version": project.version, @@ -71,7 +69,7 @@ remapJar { input.set shadowJar.archiveFile dependsOn shadowJar setArchiveClassifier(null) - setArchivesBaseName("${rootProject.archivesBaseName}-${project.name}") + setArchivesBaseName("${rootProject.archives_base_name}-${project.name}") } jar { @@ -93,41 +91,8 @@ components.java { publishing { publications { mavenForge(MavenPublication) { - artifactId = rootProject.archives_base_name + "-" + project.name + artifactId = "${rootProject.archivesBaseName}-${project.name}" from components.java } } - - // See https://docs.gradle.org/current/userguide/publishing_maven.html for information on how to set up publishing. - repositories { - if (ENV.NANITE_TOKEN) { - maven { - url "https://maven.nanite.dev/releases" - credentials { - username = "nanite" - password = "${ENV.NANITE_TOKEN}" - } - } - } - } -} - -if (ENV.CURSE_TOKEN) { - curseforge { - apiKey = ENV.CURSE_TOKEN - project { - id = project.curseforge_id - releaseType = "release" - addGameVersion "Forge" - addGameVersion "${minecraft_version}" - mainArtifact(remapJar.archiveFile) - relations { - requiredDependency("architectury-api") - } - changelog = file("../CHANGELOG.md") - changelogType = 'markdown' - } - } -} - -rootProject.tasks.curseforgePublish.dependsOn tasks.curseforge +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 27f9bee..95678cf 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,13 @@ minecraft_version=1.19.2 enabled_platforms=fabric,forge archives_base_name=ToolKit -mod_version=2.3.9 +mod_version=77.0.0 maven_group=com.sunekaer.mods -architectury_version=6.5.77 +architectury_version=6.5.85 -fabric_loader_version=0.14.21 -fabric_api_version=0.76.0+1.19.2 +fabric_loader_version=0.15.3 +fabric_api_version=0.77.0+1.19.2 -forge_version=1.19.2-43.2.8 +forge_version=43.3.7 curseforge_id=324888 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 59bc51a..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists