### Configure Modrinth Upload Task (Groovy DSL) Source: https://github.com/modrinth/minotaur/blob/master/README.md Configure the `modrinth` task for uploading to Modrinth. Ensure the MODRINTH_TOKEN environment variable is set and private. Adjust `uploadFile` based on your build setup (e.g., `remapJar` with Loom). ```groovy modrinth { token = System.getenv("MODRINTH_TOKEN") // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private! projectId = "my-project" // This can be the project ID or the slug. Either will work! versionNumber = "1.0.0" // You don't need to set this manually. Will fail if Modrinth has this version already versionType = "release" // This is the default -- can also be `beta` or `alpha` uploadFile = jar // With Loom, this MUST be set to `remapJar` instead of `jar`! gameVersions = ["1.18", "1.18.1"] // Must be an array, even with only one version loaders = ["fabric"] // Must also be an array - no need to specify this if you're using Loom or ForgeGradle dependencies { // scope.type // The scope can be `required`, `optional`, `incompatible`, or `embedded` // The type can either be `project` or `version` required.project "fabric-api" // Creates a new required dependency on Fabric API optional.version "sodium", "mc1.19.3-0.4.8" // Creates a new optional dependency on this specific version of Sodium } } ``` -------------------------------- ### Sync Project Body from README Source: https://github.com/modrinth/minotaur/blob/master/README.md Configure the plugin to sync your project's README.md content to your Modrinth project body. Exclude specific sections using HTML comments. ```groovy // build.gradle modrinth { // ... syncBodyFrom = rootProject.file("README.md").text } ``` -------------------------------- ### Configure Modrinth Upload Task (Kotlin DSL) Source: https://github.com/modrinth/minotaur/blob/master/README.md Configure the `modrinth` task in Kotlin DSL for uploading to Modrinth. Ensure the MODRINTH_TOKEN environment variable is set and kept private. For Loom projects, set `uploadFile` to `remapJar`. ```kotlin modrinth { token.set(System.getenv("MODRINTH_TOKEN")) // Remember to have the MODRINTH_TOKEN environment variable set or else this will fail - just make sure it stays private! projectId.set("my-project") // This can be the project ID or the slug. Either will work! versionNumber.set("1.0.0") // You don't need to set this manually. Will fail if Modrinth has this version already versionType.set("release") // This is the default -- can also be `beta` or `alpha` uploadFile.set(tasks.jar) // With Loom, this MUST be set to `remapJar` instead of `jar`! gameVersions.addAll("1.18", "1.18.1") // Must be an array, even with only one version loaders.add("fabric") // Must also be an array - no need to specify this if you're using Loom or ForgeGradle dependencies { // scope.type // The scope can be `required`, `optional`, `incompatible`, or `embedded` // The type can either be `project` or `version` required.project("fabric-api") // Creates a new required dependency on Fabric API optional.version("sodium", "mc1.19.3-0.4.8") // Creates a new optional dependency on this specific version of Sodium } } ``` -------------------------------- ### Enable Debug Mode for Modrinth Upload Source: https://github.com/modrinth/minotaur/blob/master/README.md Use `debugMode` to preview the data that would be uploaded without actually performing the upload. This is useful for verifying changes before publishing. ```groovy modrinth { // ... debugMode = true } ``` -------------------------------- ### Apply Minotaur Plugin (Groovy DSL) Source: https://github.com/modrinth/minotaur/blob/master/README.md Apply the Minotaur plugin to your Gradle build script using Groovy DSL. Ensure you are using a compatible version for the latest features and bug fixes. ```groovy plugins { id "com.modrinth.minotaur" version "2.+" // It's safest to have this on 2.+ to get the latest features and // bug fixes without having to worry about breaking changes. } // settings.gradle // This is probably already present. pluginManagement { repositories { gradlePluginPortal() } } ``` -------------------------------- ### Apply Minotaur Plugin (Kotlin DSL) Source: https://github.com/modrinth/minotaur/blob/master/README.md Apply the Minotaur plugin to your Gradle build script using Kotlin DSL. It's recommended to use the latest stable version for new features and fixes. ```kotlin plugins { id("com.modrinth.minotaur") version "2.+" // It's safest to have this on 2.+ to get the latest features and // bug fixes without having to worry about breaking changes. } // settings.gradle.kts // This is probably already present. pluginManagement { repositories { gradlePluginPortal() } } ``` -------------------------------- ### Accessing Upload Information Source: https://github.com/modrinth/minotaur/blob/master/README.md Provides details on how to access upload and error information after a Modrinth upload attempt. ```APIDOC ## Accessing Modrinth Upload Information ### Description This section describes how to access information related to Modrinth uploads, including success and error details. ### Properties These properties are accessible via `tasks.modrinth.`: - **uploadInfo** (Object): Contains details about a successful upload. Only available if `wasUploadSuccessful()` returns true. - **errorInfo** (Object): Contains details about a failed upload. Only available if `wasUploadSuccessful()` returns false. ### Methods - **wasUploadSuccessful()** (Boolean): - Description: Checks if the Modrinth upload operation was successful. - Usage: Should be called before attempting to access `uploadInfo` or `errorInfo` to determine which to retrieve. ### Upload Info Details - **id** (String): The unique identifier for the uploaded version. - **projectId** (String): The ID of the project to which this version belongs. - **authorId** (String): The ID of the author who published this version. - **featured** (Boolean): Indicates if the version is marked as featured. - **name** (String): The display name of this version. - **versionNumber** (String): The version number, ideally following semantic versioning. - **changelog** (String): The changelog provided for this version. - **datePublished** (Date): The date and time when the version was published. - **downloads** (Integer): The total number of downloads for this specific version. - **versionType** (VersionType): The type of release (e.g., `alpha`, `beta`, `release`). - **files** (List): A list of files associated with this version. - **gameVersions** (List): A list of game versions this mod version supports. - **loaders** (List): A list of mod loaders this version is compatible with. - **dependency** (Dependency): Information about other mods this version depends on. ### Error Info Details - **error** (String): The type of error encountered during the upload (e.g., 'authorization error'). - **description** (String): A detailed message explaining the error. ``` -------------------------------- ### Make ModrinthSyncBody Depend on Modrinth Source: https://github.com/modrinth/minotaur/blob/master/README.md Ensure the project body is synced with every publish by making the `modrinthSyncBody` task depend on the `modrinth` task. ```groovy tasks.modrinth.dependsOn(tasks.modrinthSyncBody) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.