Skip to content

Commit

Permalink
Add publishing plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
Provismet committed Sep 15, 2024
1 parent 6764e7e commit 3a0d337
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 3 deletions.
46 changes: 45 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.7-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 @@ -81,10 +82,53 @@ 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 = true
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
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 @@
_Example patch notes_
12 changes: 10 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,18 @@ loader_version=0.15.11

# Mod Properties
mod_version=2.0.1
maven_group=com.provismet
maven_group=com.github.Provismet
archives_base_name=combatplus-core
modid=combat-plus-core

# Dependencies
fabric_version=0.98.0+1.20.6
lilylib_version=1.1.3-mc1.20.6
lilylib_version=1.1.3-mc1.20.6

# Publishing
github_repo = CombatPlus-Core
github_branch = 1.20.6
modrinth_id = NbKFMiE7
curseforge_id = 973671
version_start = 1.20.5
version_end = 1.20.6

0 comments on commit 3a0d337

Please sign in to comment.