Skip to content

Commit 104d68c

Browse files
committed
Update deps, move from minotaur to mod-publish-plugin
Minotaur is barely maintained, and mod-publish-plugin lets us remove the annoying version handling
1 parent c7702cc commit 104d68c

6 files changed

Lines changed: 39 additions & 53 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
cache-disabled: false
2121
cache-provider: basic
2222
- name: Set up JDK 17
23-
uses: actions/setup-java@v6.0.1
23+
uses: actions/setup-java@v6.1.0
2424
with:
2525
distribution: 'temurin'
2626
java-version: 17

‎.github/workflows/publish.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
cache-disabled: false
2626
cache-provider: basic
2727
- name: Set up JDK 17
28-
uses: actions/setup-java@v6.0.1
28+
uses: actions/setup-java@v6.1.0
2929
with:
3030
distribution: 'temurin'
3131
java-version: 17
@@ -40,5 +40,5 @@ jobs:
4040
- name: Publish to Modrinth
4141
env:
4242
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
43-
run: ./gradlew modrinth --stacktrace
43+
run: ./gradlew publishMods --stacktrace
4444
continue-on-error: true

‎gradle.properties‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
projectVersion=5.12.2-SNAPSHOT
22

3-
# Smile emoji (note that modrinth may not have added the version on release yet)
4-
mcVersions=26.3, 26.2, 26.1.2, 26.1.1, 26.1, 1.21.11, 1.21.10, 1.21.9, 1.21.8, 1.21.7, 1.21.6, 1.21.5, 1.21.4, 1.21.3, 1.21.2, 1.21.1, 1.21, 1.20.6, 1.20.5, 1.20.4, 1.20.3, 1.20.2, 1.20.1, 1.20, 1.19.4, 1.19.3, 1.19.2, 1.19.1, 1.19, 1.18.2, 1.18.1, 1.18, 1.17.1, 1.17, 1.16.5, 1.16.4, 1.16.3, 1.16.2, 1.16.1, 1.16, 1.15.2, 1.15.1, 1.15, 1.14.4, 1.14.3, 1.14.2, 1.14.1, 1.14, 1.13.2, 1.13.1, 1.13, 1.12.2, 1.12.1, 1.12, 1.11.2, 1.11.1, 1.11, 1.10.2, 1.10.1, 1.10
3+
# note that modrinth may not have added the version on release yet
54
mcVersionRange=1.10-26.3
65
velocityVersion=3.4-4.2.1
76

‎gradle/libs.versions.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ netty = "4.0.20.Final"
1010
guava = "17.0"
1111
log4j = "2.8.1"
1212

13-
checkerQual = "4.3.0"
13+
checkerQual = "4.3.1"
1414

1515
# Platforms
1616
paper = "1.16.5-R0.1-SNAPSHOT"

‎gradle/wrapper/gradle-wrapper.properties‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=dce76f55f8e251a3a1f130eb120f30b3d271de2b76c9b0729d316b5a1b6dc01f
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.1-bin.zip
3+
distributionSha256Sum=21bd5da2de49b642904077f38c0efdc7778e92b3ed0889392dca61b97e389607
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip
55
networkTimeout=10000
66
retries=0
77
retryBackOffMs=500

‎universal/build.gradle.kts‎

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
import com.modrinth.minotaur.TaskModrinthUpload
2-
31
plugins {
2+
id("me.modmuss50.mod-publish-plugin") version "2.2.1"
43
id("io.papermc.hangar-publish-plugin") version "0.1.4"
5-
id("com.modrinth.minotaur") version "2.+"
64

75
// A nice no-conflict comment for patching in downgrading
86
}
@@ -45,45 +43,37 @@ if (runNumber != null && (!isRelease || isMainBranch)) { // Only publish release
4543
val commitHash = rootProject.latestCommitHash()
4644
"[$commitHash](https://github.com/ViaVersion/ViaBackwards/commit/$commitHash) ${rootProject.latestCommitMessage()}"
4745
}
48-
val mcVersions: List<String> = (property("mcVersions") as String)
49-
.split(",")
50-
.map { it.trim() }
51-
modrinth {
52-
token.set(System.getenv("MODRINTH_TOKEN"))
53-
projectId.set("viabackwards")
54-
versionType.set(if (isRelease) "release" else if (isMainBranch) "beta" else "alpha")
55-
versionNumber.set(suffixedVersion)
56-
versionName.set(suffixedVersion)
57-
changelog.set(changelogContent)
58-
uploadFile.set(tasks.shadowJar.flatMap { it.archiveFile })
59-
gameVersions.set(mcVersions)
60-
loaders.add("paper")
61-
loaders.add("folia")
62-
loaders.add("velocity")
63-
autoAddDependsOn.set(false)
64-
detectLoaders.set(false)
65-
dependencies {
66-
required.project("viaversion")
67-
optional.project("viafabric")
68-
optional.project("viarewind")
46+
val mcVersionRange = property("mcVersionRange") as String
47+
val (mcVersionStart, mcVersionEnd) = mcVersionRange.split("-", limit = 2)
48+
publishMods {
49+
file = tasks.shadowJar.flatMap { it.archiveFile }
50+
type = if (isRelease) STABLE else if (isMainBranch) BETA else ALPHA
51+
version = suffixedVersion
52+
displayName = suffixedVersion
53+
changelog = changelogContent
54+
55+
val modrinthOptions = modrinthOptions {
56+
accessToken = providers.environmentVariable("MODRINTH_TOKEN")
57+
projectId = "viabackwards"
58+
requires("viaversion")
59+
optional("viafabric", "viarewind")
6960
}
70-
}
71-
tasks.modrinth {
72-
notCompatibleWithConfigurationCache("")
73-
finalizedBy("modrinthFabric")
74-
}
75-
// Fabric requires 1.14+ (18w43b), so it is uploaded separately with only the supported versions...
76-
val modrinthExtension = modrinth
77-
tasks.register<TaskModrinthUpload>("modrinthFabric") {
78-
group = "publishing"
79-
dependsOn(tasks.assemble)
80-
notCompatibleWithConfigurationCache("")
81-
doFirst {
82-
modrinthExtension.loaders.set(listOf("fabric"))
83-
modrinthExtension.gameVersions.set(mcVersions.filter { version ->
84-
val (major, minor) = version.split(".").map(String::toInt)
85-
major > 1 || minor >= 14
86-
})
61+
modrinth {
62+
from(modrinthOptions)
63+
modLoaders.addAll("paper", "folia", "velocity")
64+
minecraftVersionRange {
65+
start = mcVersionStart
66+
end = mcVersionEnd
67+
}
68+
}
69+
// Fabric requires 1.14+ (18w43b), so it is uploaded separately with only the supported versions...
70+
modrinth("modrinthFabric") {
71+
from(modrinthOptions)
72+
modLoaders.add("fabric")
73+
minecraftVersionRange {
74+
start = "1.14"
75+
end = mcVersionEnd
76+
}
8777
}
8878
}
8979

@@ -97,7 +87,7 @@ if (runNumber != null && (!isRelease || isMainBranch)) { // Only publish release
9787
platforms {
9888
paper {
9989
jar = tasks.shadowJar.flatMap { it.archiveFile }
100-
platformVersions = listOf(property("mcVersionRange") as String)
90+
platformVersions = listOf(mcVersionRange)
10191
dependencies {
10292
hangar("ViaVersion") {
10393
required = true
@@ -122,7 +112,4 @@ if (runNumber != null && (!isRelease || isMainBranch)) { // Only publish release
122112
}
123113
}
124114
}
125-
tasks.named("publishPluginPublicationToHangar") {
126-
notCompatibleWithConfigurationCache("")
127-
}
128115
}

0 commit comments

Comments
 (0)