@@ -74,185 +74,3 @@ sourcesJar {
7474 from commonSources. archiveFile. map { zipTree(it) }
7575 duplicatesStrategy = DuplicatesStrategy . EXCLUDE
7676}
77-
78- publisher {
79- // Setup the required API keys. You only need to define the keys for
80- // the platforms you plan on uploading to
81- apiKeys {
82- // Modrinth Token
83- modrinth System . getenv(" MODRINTH_TOKEN" )
84- // Curseforge Token
85- curseforge System . getenv(" CURSE_TOKEN" )
86- // GitHub Token
87- // github System.getenv("GITHUB_TOKEN")
88- }
89-
90- // Enable Debug mode. When enabled, no files will actually be uploaded
91- setDebug(publish_debug_mode. toBoolean())
92-
93- // Modrinth Project ID
94- setModrinthID(modrinth_id)
95-
96- // Curseforge Project ID
97- setCurseID(curseforge_id)
98-
99- // Type of release. beta, alpha or release
100- // You can also use VersionType.BETA, VersionType.ALPHA or VersionType.RELEASE
101- setVersionType(release_type)
102-
103- // Changelog. This can be a file, string, OR, gist/github url
104- // For example: markdown.md, or "This is my changelog"
105- // Or: https://raw.githubusercontent.com/hypherionmc/changelogs/changelog.md
106- // Or https://gist.githubusercontent.com/hypherionmc/92f825d3c9337964cc77c9c8c9bf65e6/raw/ceeaaee5b98c688a23398864fe480b84796a1651/test_gist.md
107- setChangelog(file(" $rootDir /docs/changelogs/${ mod_version} .md" ). text. trim())
108-
109- // Required for Modrinth/GitHub
110- setProjectVersion(mod_version)
111-
112- boolean quiltCompatible
113- if (rootProject. hasProperty(" fabric_is_quilt_compatible" )){
114- quiltCompatible = rootProject. fabric_is_quilt_compatible. toBoolean()
115- }
116- else {
117- quiltCompatible = default_quilt_compatibility. toBoolean()
118- }
119-
120- // Fancy display name for the upload.
121- // Will default to the project version if not set
122- String DisplayName
123- if (quiltCompatible) {
124- DisplayName = " [Fabric & Quilt | ${ rootProject.file_name} ] ${ mod_version} "
125- }
126- else {
127- DisplayName = " [Fabric | ${ rootProject.file_name} ] ${ mod_version} "
128- }
129- setDisplayName(DisplayName )
130-
131- String gameVersionsString = rootProject. compatible_minecraft_versions
132- def gameVersions = gameVersionsString. replace(" [" , " " ). replace(" ]" , " " ). replaceAll(" " , " " ). replaceAll(" \" " , " " ). split(" ," )
133- // The supported game versions
134- setGameVersions(gameVersions)
135-
136- // The modloaders your upload supports.
137- // This can also be an Enum from ModLoader,
138- // like setLoaders(ModLoader.FABRIC, ModLoader.FORGE)
139- if (quiltCompatible) {
140- setLoaders(" fabric" , " quilt" )
141- }
142- else {
143- setLoaders(" fabric" )
144- }
145-
146- // The new Curseforge Environment tag. Optional
147- // Valid values are "server", "client" or "both"
148- // You can also use CurseEnvironment.BOTH, or CurseEnvironment.SERVER or CurseEnvironment.CLIENT
149- setCurseEnvironment(curse_environment)
150-
151- // The file to be uploaded. This can be a file, task, or string.
152- // setArtifact("build/libs/mymod.jar")
153- // setArtifact(jar.getArchiveFile().get())
154- // If this is a task, the task specified will be executed before publishing
155- // setArtifact(remapJar)
156- setArtifact(" build/libs/${ mod_id} -fabric-${ rootProject.versionStr} .jar" )
157-
158- // Override the artifact uploaded to modrinth
159- // setPlatformArtifact(Platform.Modrinth, "build/libs/mymod.jar")
160- // setPlatformArtifact(Platform.Modrinth, jar.getArchiveFile().get())
161- // If this is a task, the task specified will be executed before publishing
162- // Valid platforms are modrinth, curseforge and github
163- // setPlatformArtifact("modrinth", modrinthJar)
164-
165- // Disable the built in Fractureizer scanner
166- setDisableMalwareScanner(false )
167-
168- // Add supported java versions. Currently only used by CurseForge
169- // Supports anything that can be parsed using JavaVersion.toVersion()
170- setJavaVersions([rootProject. java_version as Integer ] as Integer [])
171-
172- // Safety check to check if the artifact contains a valid mod metadata entry,
173- // which could possibly mean that the jar is empty
174- setDisableEmptyJarCheck(false )
175-
176- // Additional files to upload. Same as artifact, this can be a task, file or string
177- addAdditionalFile(" build/libs/${ mod_id} -fabric-${ rootProject.versionStr} -sources.jar" )
178-
179- // Additional files to upload with a custom display name and changelog.
180- // Currently only supported on Curseforge
181- // addAdditionalFile {
182- // // File, Task or String
183- // artifact jar
184- // displayName "Some Name"
185- // changelog "Hello Changelog"
186- // }
187-
188- // GitHub options
189- github {
190- // GitHub repo to publish to. Overrides githubRepo
191- repo(mod_source)
192-
193- // Tag to use for GitHub release. Defaults to version
194- tag(" v${ mod_version} " )
195-
196- // Whether to create a tag for the GitHub release, if one doesn't exist yet. Defaults to true
197- createTag(true )
198-
199- // Whether to create the GitHub release if it doesn't exist yet. Defaults to true
200- createRelease(true )
201-
202- // Whether to update the GitHub release if it already exists. Defaults to true
203- updateRelease(true )
204-
205- // Whether the release should be left as an unpublished draft.
206- //
207- // If enabled, newly created releases and existing drafts will not be published.
208- // Instead, a draft release is used.
209- //
210- // If disabled, the release will be published.
211- // This option does not allow converting a published release to a draft.
212- //
213- // Defaults to false
214- draft(github_draft. toBoolean())
215-
216- // The commitish ref the tag should target (ignored when tag already exists)
217- target(github_target)
218-
219- displayName(DisplayName )
220- }
221-
222- // Modrinth Dependencies.
223- // Accepts a slug or id
224- modrinthDepends {
225- // Multiple required dependencies
226- // required "fabric-api", "craterlib"
227-
228- // Single dependency
229- required " fabric-api"
230-
231- // Optional dependency
232- // optional 'optional-dep'
233-
234- // Your mod is not compatible with this mod
235- // incompatible 'breaks-with'
236-
237- // Your mod embeds this dependency
238- // embedded 'fabric-api'
239- }
240-
241- // Curse Dependencies
242- curseDepends {
243- // Multiple required dependencies
244- // required "fabric-api", "craterlib"
245-
246- // Single dependency
247- required " fabric-api"
248-
249- // Optional dependency
250- // optional 'optional-dep'
251-
252- // Your mod is not compatible with this mod
253- // incompatible 'breaks-with'
254-
255- // Your mod embeds this dependency
256- // embedded 'fabric-api'
257- }
258- }
0 commit comments