Mirror von
https://github.com/GeyserMC/Geyser.git
synchronisiert 2024-11-05 07:40:11 +01:00
Feature: Modrinth version names (#4989)
* Feature: Version names on modrinth published builds * Also change the fabric/neoforge jar file names
Dieser Commit ist enthalten in:
Ursprung
2274377814
Commit
efe8077093
@ -118,3 +118,12 @@ open class DownloadFilesTask : DefaultTask() {
|
||||
private fun calcExclusion(section: String, bit: Int, excludedOn: Int): String =
|
||||
if (excludedOn and bit > 0) section else ""
|
||||
|
||||
fun projectVersion(project: Project): String =
|
||||
project.version.toString().replace("SNAPSHOT", "b" + buildNumber())
|
||||
|
||||
fun versionName(project: Project): String =
|
||||
"Geyser-" + project.name.replaceFirstChar { it.uppercase() } + "-" + projectVersion(project)
|
||||
|
||||
fun buildNumber(): Int =
|
||||
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
|
||||
|
||||
|
@ -87,7 +87,7 @@ tasks {
|
||||
register("remapModrinthJar", RemapJarTask::class) {
|
||||
dependsOn(shadowJar)
|
||||
inputFile.set(shadowJar.get().archiveFile)
|
||||
archiveVersion.set(project.version.toString() + "+build." + System.getenv("BUILD_NUMBER"))
|
||||
archiveVersion.set(versionName(project))
|
||||
archiveClassifier.set("")
|
||||
}
|
||||
}
|
||||
|
@ -8,7 +8,8 @@ tasks.modrinth.get().dependsOn(tasks.modrinthSyncBody)
|
||||
modrinth {
|
||||
token.set(System.getenv("MODRINTH_TOKEN") ?: "") // Even though this is the default value, apparently this prevents GitHub Actions caching the token?
|
||||
projectId.set("geyser")
|
||||
versionNumber.set(project.version as String + "-" + System.getenv("BUILD_NUMBER"))
|
||||
versionName.set(versionName(project))
|
||||
versionNumber.set(projectVersion(project))
|
||||
versionType.set("beta")
|
||||
changelog.set(System.getenv("CHANGELOG") ?: "")
|
||||
gameVersions.addAll("1.21", libs.minecraft.get().version as String)
|
||||
|
@ -103,9 +103,6 @@ sourceSets {
|
||||
}
|
||||
}
|
||||
|
||||
fun buildNumber(): Int =
|
||||
(System.getenv("BUILD_NUMBER"))?.let { Integer.parseInt(it) } ?: -1
|
||||
|
||||
fun isDevBuild(branch: String, repository: String): Boolean {
|
||||
return branch != "master" || repository.equals("https://github.com/GeyserMC/Geyser", ignoreCase = true).not()
|
||||
}
|
||||
@ -139,7 +136,7 @@ inner class GitInfo {
|
||||
|
||||
buildNumber = buildNumber()
|
||||
isDev = isDevBuild(branch, repository)
|
||||
val projectVersion = if (isDev) project.version else project.version.toString().replace("SNAPSHOT", "b${buildNumber}")
|
||||
val projectVersion = if (isDev) project.version else projectVersion(project)
|
||||
version = "$projectVersion ($gitVersion)"
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren