Skip to content

Commit

Permalink
Add mod publishing plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Provismet committed Nov 30, 2024
1 parent 3b1aea2 commit b4d8193
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
45 changes: 45 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'fabric-loom' version '1.8-SNAPSHOT'
id 'maven-publish'
id 'me.modmuss50.mod-publish-plugin' version '0.6.3'
}

version = project.mod_version + "+" + project.minecraft_version
Expand Down Expand Up @@ -62,10 +63,54 @@ jar {
}
}

publishMods {
file = remapJar.archiveFile
additionalFiles.from(remapSourcesJar.archiveFile)
changelog = file("changelog.md").text
type = STABLE
modLoaders.add("fabric")
modLoaders.add("quilt")
displayName = project.version.toString()
dryRun = providers.environmentVariable("GITHUB_TOKEN").getOrNull() == null || providers.environmentVariable("MODRINTH_TOKEN").getOrNull() == null || providers.environmentVariable("CURSEFORGE_TOKEN").getOrNull() == null

github {
repository = "Provismet/${project.github_repo}"
accessToken = providers.environmentVariable("GITHUB_TOKEN")
commitish = "${project.github_branch}"
tagName = "${project.mod_version}-mc${project.minecraft_version}"
allowEmptyFiles = true
displayName = "${project.mod_version} - ${project.minecraft_version}"
}

modrinth {
projectId = project.modrinth_id
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
minecraftVersionRange {
start = project.version_start
end = project.version_end
}
requires("fabric-api")
}

curseforge {
projectId = project.curseforge_id
accessToken = providers.environmentVariable("CURSEFORGE_TOKEN")
clientRequired = true
serverRequired = false
minecraftVersionRange {
start = project.version_start
end = project.version_end
}
requires("fabric-api")
}
}

// configure the maven publication
publishing {
publications {
mavenJava(MavenPublication) {
version = project.mod_version + "-mc" + project.minecraft_version
artifactId = project.archives_base_name
from components.java
}
}
Expand Down
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated to 1.21.3.
8 changes: 8 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,11 @@ archives_base_name=vmc-mc
fabric_version=0.110.0+1.21.3
cloth_version=16.0.141
modmenu_version=12.0.0-beta.1

# Publishing
github_repo=VMC-MC
github_branch=1.21.2
modrinth_id=ub8B8TcT
curseforge_id=922189
version_start=1.21.2
version_end=1.21.3

0 comments on commit b4d8193

Please sign in to comment.