Skip to content

Commit

Permalink
This is better!
Browse files Browse the repository at this point in the history
  • Loading branch information
enjarai committed Jun 24, 2024
1 parent 4acab1a commit da7f4b1
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
matrix:
# Use these Java versions
java: [
17, # Current Java LTS & minimum supported by Minecraft
21, # Current Java LTS & minimum supported by Minecraft
]
# and run on both Linux and Windows
os: [ubuntu-20.04, windows-2022]
Expand Down
77 changes: 73 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ plugins {
id 'fabric-loom' version '1.7-SNAPSHOT'
id 'maven-publish'
id 'me.fallenbreath.yamlang' version '1.3.1'
id "me.modmuss50.mod-publish-plugin" version "0.4.4"
}

sourceCompatibility = JavaVersion.VERSION_21
Expand All @@ -13,10 +14,10 @@ group = project.maven_group

repositories {
maven {
url "https://maven.enjarai.nl/releases"
url "https://maven.enjarai.dev/releases"
}
maven {
url "https://maven.enjarai.nl/mirrors"
url "https://maven.enjarai.dev/mirrors"
}

maven {
Expand All @@ -35,7 +36,7 @@ dependencies {

modImplementation include("nl.enjarai:shared-resources-api:${project.shared_resources_version}")

include modImplementation("nl.enjarai:cicada-lib:${project.cicada_version}") {
modImplementation("nl.enjarai:cicada-lib:${project.cicada_version}") {
exclude group: "net.fabricmc.fabric-api"
}
}
Expand Down Expand Up @@ -69,7 +70,7 @@ publishing {
repositories {
maven {
name = "enjaraiMaven"
url = "https://maven.enjarai.nl/releases"
url = "https://maven.enjarai.dev/releases"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
Expand All @@ -92,3 +93,71 @@ yamlang {
targetSourceSets = [sourceSets.main]
inputDir = 'assets/recursiveresources/lang'
}

publishMods {
file = remapJar.archiveFile
displayName = "${property('mod_version')} for ${property('minecraft_version')}"
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')

if (providers.gradleProperty('enjaraiModrinthToken').present) {
modrinth {
projectId = property('mod_modrinth')
accessToken = providers.gradleProperty('enjaraiModrinthToken').get()

if (min == max) {
minecraftVersions.add(min)
} else {
minecraftVersionRange {
start = min
end = max
}
}

requires {
slug = "fabric-api"
}
requires {
slug = "cicada"
}
}
}

if (providers.gradleProperty('enjaraiCurseforgeToken').present) {
curseforge {
projectId = property('mod_curseforge')
accessToken = providers.gradleProperty('enjaraiCurseforgeToken').get()

if (min == max) {
minecraftVersions.add(min)
} else {
minecraftVersionRange {
start = min
end = max
}
}

requires {
slug = "fabric-api"
}
requires {
slug = "cicada"
}
}
}

if (providers.gradleProperty('enjaraiGithubToken').present) {
github {
repository = property('mod_github')
accessToken = providers.gradleProperty('enjaraiGithubToken').get()

commitish = property('git_branch')
tagName = project.version
}
}
}
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ mod_version=2.5.3
maven_group=nl.enjarai
archives_base_name=recursive-resources

publish_target_min=1.21
publish_target_max=1.21
mod_modrinth=CcL3MXyI
mod_curseforge=674907
mod_github=enjarai/recursive-resources
git_branch=master

fabric_version=0.100.3+1.21
# https://modrinth.com/mod/modmenu/versions
modmenu_version=11.0.0
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"depends": {
"minecraft": ">=1.21",
"fabric-api": "*",
"cicada": "*",
"cicada": ">=0.8.0 <1.0.0",
"fabricloader": ">=0.15"
},

Expand Down

0 comments on commit da7f4b1

Please sign in to comment.