Skip to content

Commit

Permalink
Use publish all plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Kotori316 committed Dec 8, 2024
1 parent 2ef60fb commit 7bddb6c
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_forge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: 'Kotori316/common-script/.github/workflows/release-prod-gradle.yaml@main'
with:
sign_check_command: 'assemble publishToMavenLocal'
release_command: 'assemble publishToMavenLocal publish curseforge modrinth githubRelease registerVersion'
release_command: 'assemble publishToMavenLocal publish publishMods githubRelease registerVersion'
enable_signature_check: true
java_version: 21
use_gradle_cache: true
Expand Down
64 changes: 30 additions & 34 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ plugins {
id "net.minecraftforge.gradle" version "[6.0.16,6.2)"
id "org.parchmentmc.librarian.forgegradle" version "1.+"
id "signing"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
alias(libs.plugins.publish.all)
}

version = "${libs.versions.scala3.get()}-build-${project.build_number}"
Expand Down Expand Up @@ -137,42 +136,39 @@ tasks.withType(JavaCompile).configureEach {
// ---------- Publish ----------
final boolean RELEASE_DEBUG = Boolean.parseBoolean(System.getenv("RELEASE_DEBUG") ?: "true")

curseforge {
apiKey = project.findProperty("curseforge_additional-enchanted-miner_key") ?: System.getenv("CURSE_TOKEN") ?: ""
project {
id = "320926"
changelogType = "markdown"
changelog = createChangelog()
releaseType = "release"
addGameVersion(libs.versions.minecraft.get())
addGameVersion("Forge")
mainArtifact(tasks.shadowJar)
addArtifact(tasks.jar)
addArtifact(tasks.sourcesJar)
addArtifact(tasks.jarJar)
publishMods {
dryRun = RELEASE_DEBUG
type = STABLE
file = provider { tasks.shadowJar }.flatMap { it.archiveFile }
additionalFiles = files(
provider { tasks.jar }.flatMap { it.archiveFile },
provider { tasks.sourcesJar }.flatMap { it.archiveFile },
provider { tasks.jarJar }.flatMap { it.archiveFile },
)
modLoaders = ["forge"]
displayName = "${project.version}-forge"
changelog = createChangelog()

def endVersion = "1.21.4"
curseforge {
accessToken = (project.findProperty("curseforge_additional-enchanted-miner_key") ?: System.getenv("CURSE_TOKEN") ?: "") as String
projectId = "320926"
minecraftVersionRange {
start = libs.versions.minecraft.get()
end = endVersion
}
}
options {
curseGradleOptions.debug = RELEASE_DEBUG // defaults to false
curseGradleOptions.javaVersionAutoDetect = false
modrinth {
accessToken = (project.findProperty("modrinthToken") ?: System.getenv("MODRINTH_TOKEN") ?: "") as String
projectId = "zr0QMQMo"
minecraftVersionRange {
start = libs.versions.minecraft.get()
end = endVersion
includeSnapshots = false
}
}
}

modrinth {
token = project.findProperty("modrinthToken") ?: System.getenv("MODRINTH_TOKEN") ?: ""
projectId = "scalable-cats-force"
versionType = "release"
uploadFile = tasks.shadowJar
additionalFiles = [
tasks.jar,
tasks.sourcesJar,
tasks.jarJar,
]
gameVersions = [libs.versions.minecraft.get()]
loaders = ["forge"]
changelog = createChangelog()
debugMode = RELEASE_DEBUG
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ plugin_cf = "3.3"
plugin_shadow = "8.+"
plugin_idea_ext = "1.1.9"
plugin_ghr = "2.5.2"
plugin_publish_all = "0.+"

[libraries]
scala2 = { group = "org.scala-lang", name = "scala-library", version.ref = "scala2" }
Expand All @@ -42,6 +43,7 @@ cf = { id = "com.kotori316.plugin.cf", version.ref = "plugin_cf" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "plugin_shadow" }
idea = { id = "org.jetbrains.gradle.plugin.idea-ext", version.ref = "plugin_idea_ext" }
ghr = { id = "com.github.breadmoirai.github-release", version.ref = "plugin_ghr" }
publish-all = { id = "me.modmuss50.mod-publish-plugin", version.ref = "plugin_publish_all" }

[bundles]
cats = ["cats-kernel", "cats-core", "cats-free"]
65 changes: 30 additions & 35 deletions neoforge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ plugins {
id("com.kotori316.common.publish")
id "net.neoforged.gradle.userdev" version "7.0.171"
id "signing"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
alias(libs.plugins.publish.all)
}

version = "${libs.versions.scala3.get()}-build-${project.build_number}"
Expand Down Expand Up @@ -108,43 +107,39 @@ tasks.test {
// ---------- Publish ----------
final boolean RELEASE_DEBUG = Boolean.parseBoolean(System.getenv("RELEASE_DEBUG") ?: "true")

curseforge {
apiKey = project.findProperty("curseforge_additional-enchanted-miner_key") ?: System.getenv("CURSE_TOKEN") ?: ""
project {
id = "320926"
changelogType = "markdown"
changelog = createChangelog()
releaseType = "release"
addGameVersion(libs.versions.minecraft.get())
addGameVersion("NeoForge")
mainArtifact(tasks.shadowJar)
addArtifact(tasks.jar)
addArtifact(tasks.sourcesJar)
addArtifact(tasks.jarJar)
publishMods {
dryRun = RELEASE_DEBUG
type = STABLE
file = provider { tasks.shadowJar }.flatMap { it.archiveFile }
additionalFiles = files(
provider { tasks.jar }.flatMap { it.archiveFile },
provider { tasks.sourcesJar }.flatMap { it.archiveFile },
provider { tasks.jarJar }.flatMap { it.archiveFile },
)
modLoaders = ["neoforge"]
displayName = "${project.version}-neoforge"
changelog = createChangelog()

def endVersion = "1.21.4"
curseforge {
accessToken = (project.findProperty("curseforge_additional-enchanted-miner_key") ?: System.getenv("CURSE_TOKEN") ?: "") as String
projectId = "320926"
minecraftVersionRange {
start = libs.versions.minecraft.get()
end = endVersion
}
}
options {
curseGradleOptions.debug = RELEASE_DEBUG // defaults to false
curseGradleOptions.javaVersionAutoDetect = false
curseGradleOptions.forgeGradleIntegration = false
modrinth {
accessToken = (project.findProperty("modrinthToken") ?: System.getenv("MODRINTH_TOKEN") ?: "") as String
projectId = "zr0QMQMo"
minecraftVersionRange {
start = libs.versions.minecraft.get()
end = endVersion
includeSnapshots = false
}
}
}

modrinth {
token = project.findProperty("modrinthToken") as String ?: System.getenv("MODRINTH_TOKEN") ?: ""
projectId = "scalable-cats-force"
versionType = "release"
uploadFile = tasks.shadowJar
additionalFiles = [
tasks.jar,
tasks.sourcesJar,
tasks.jarJar,
]
gameVersions = [libs.versions.minecraft.get()]
loaders = ["neoforge"]
changelog = createChangelog()
debugMode = RELEASE_DEBUG
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down

0 comments on commit 7bddb6c

Please sign in to comment.