Skip to content

Commit

Permalink
Added mod publisher to gradle setup
Browse files Browse the repository at this point in the history
  • Loading branch information
pedroksl committed Dec 24, 2024
1 parent 1b78517 commit e4b4cc1
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 147 deletions.
24 changes: 0 additions & 24 deletions .github/actions/gradle-setup/action.yml

This file was deleted.

115 changes: 0 additions & 115 deletions .github/workflows/release.yml

This file was deleted.

96 changes: 88 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import com.hypherionmc.modpublisher.properties.ModLoader

plugins {
id 'java-library'
id 'maven-publish'
id 'net.neoforged.moddev' version '1.0.17'
id 'com.diffplug.spotless'
id "com.hypherionmc.modutils.modpublisher" version '2.1.6'
}

tasks.named('wrapper', Wrapper).configure {
Expand All @@ -17,7 +20,7 @@ repositories {
}

base {
archivesName = mod_id
archivesName = mod_name.replace(" ", "")
}

java.toolchain.languageVersion = JavaLanguageVersion.of(21)
Expand Down Expand Up @@ -190,14 +193,91 @@ idea {
}
}

spotless {
// kotlinGradle {
// target("*.kts")
// diktat()
// indentWithTabs(1)
// endWithNewline()
// }
publisher {
apiKeys {
// Modrinth Token
modrinth System.getenv("MODRINTH_TOKEN")
// Curseforge Token
curseforge System.getenv("CURSE_TOKEN")
// GitHub Token
github System.getenv("GITHUB_TOKEN")
}

// Enable Debug mode. When enabled, no files will actually be uploaded
setDebug(false)

// Curseforge Project ID
setCurseID("1084104")

// Modrinth Project ID
setModrinthID("rxYaglEe")

// Type of release. beta, alpha or release
// You can also use VersionType.BETA, VersionType.ALPHA or VersionType.RELEASE
setVersionType("RELEASE")

// Changelog. This can be a file, string, OR, gist/github url
// For example: markdown.md, or "This is my changelog"
// Or: https://raw.githubusercontent.com/hypherionmc/changelogs/changelog.md
// Or https://gist.githubusercontent.com/hypherionmc/92f825d3c9337964cc77c9c8c9bf65e6/raw/ceeaaee5b98c688a23398864fe480b84796a1651/test_gist.md
setChangelog("https://raw.githubusercontent.com/pedroksl/AdvancedAE/refs/heads/master/CHANGELOG.md")

// Required for Modrinth/GitHub
setProjectVersion("${project.version}")

// Fancy display name for the upload.
// Will default to the project version if not set
setDisplayName("AdvancedAE-${project.version}")

// The supported game versions
setGameVersions("${project.minecraft_version}")

// The modloaders your upload supports.
// This can also be an Enum from ModLoader,
// like setLoaders(ModLoader.FABRIC, ModLoader.FORGE)
setLoaders(ModLoader.NEOFORGE)

// The new Curseforge Environment tag. Optional
// Valid values are "server", "client" or "both"
// You can also use CurseEnvironment.BOTH, or CurseEnvironment.SERVER or CurseEnvironment.CLIENT
setCurseEnvironment("both")

// The file to be uploaded. This can be a file, task, or string.
// setArtifact("build/libs/mymod.jar")
// setArtifact(jar.getArchiveFile().get())
// If this is a task, the task specified will be executed before publishing
setArtifact("build/libs/${project.mod_name.replace(" ", "")}-${project.version}.jar")

// Disable the built in Fractureizer scanner
setDisableMalwareScanner(true)

// Safety check to check if the artifact contains a valid mod metadata entry,
// which could possibly mean that the jar is empty
setDisableEmptyJarCheck(true)

github {
repo = "pedroksl/AdvancedAE"

tag = "${project.version}-neoforge"

createTag = true
createRelease = true
draft = false
updateRelease = true

displayName = "AdvancedAE-${project.version}"
}

curseDepends {
required "applied-energistics-2", "glodium", "geckolib"
}

modrinthDepends {
required "ae2", "glodium", "geckolib"
}
}

spotless {
java {
target("/src/**/java/**/*.java")
endWithNewline()
Expand Down
3 changes: 3 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ pluginManagement {
mavenLocal()
gradlePluginPortal()
maven { url = 'https://maven.neoforged.net/releases' }
maven {
url "https://maven.firstdark.dev/releases"
}
}
plugins {
id("com.diffplug.spotless") version "6.25.0"
Expand Down

0 comments on commit e4b4cc1

Please sign in to comment.