Skip to content

Commit

Permalink
Automate publishing to GitHub, CurseGradle and Modrinth
Browse files Browse the repository at this point in the history
Just bump the version and update the changelog, create the release commit, tag
it, push it and then run `./gradlew publishAll`.
  • Loading branch information
Johni0702 committed Mar 25, 2021
1 parent e38c621 commit 74990e6
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 1 deletion.
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
### 1.1.4
- Fix chunk flicker with Sodium when real chunk receives full update

### 1.1.3
- Fix regression introduced in 1.1.2 causing real chunks to not render with Sodium (#20)

### 1.1.2
- Fix light sometimes not updating on block breaking/placing due to race condition in Sodium-specific code (#19)

### 1.1.1
- Re-add chunk unload throttling, fixes short freeze when many chunks are unloaded (potentially 60 seconds after a teleport depending on unload delay)

### 1.1.0
- Vastly reduce main thread freezes when loading/unloading huge amounts of chunks by bypassing the lighting engine for fake chunks
- Add configurable delay to chunk unloading (default 60 seconds) so they do not need to be re-loaded when returning within the delay.
- Fix crashes due to thread-unsafe block entity initialization

### 1.0.0
- Add max render distance overwrite as config option (requires Sodium)
- Add singleplayer view-distance overwrite option (closes #2, closes #7)
- Add support for ingame config via ModMenu + ClothConfig (#2)
- Add basic config file (auto-reloads) for en-/disabling the mod (closes #2)
- Fix crash when connecting to server with port on Windows (fixes #5)
- Optimize chunk load/unload management
- Fix fake chunk loading becoming starved at high render distance
- Significantly reduce time spent on main thread for chunk loading
- Remove freezing on fake chunk loading thanks to the previous point and by spreading them out over multiple frame
- Reduce freezing on fake chunk unloading by spreading them out over multiple frame, though there is still one spike at the very end which I am unsure how to get rid of (light engine related)
- Fix invalid profiler.pop()

### 0.2.0
- Support for Sodium 0.1.0
- Fix various lighting issues
- Fix local cache becoming corrupt when switching between worlds too quickly (i.e. re-entering the same world before its cache was fully saved)
- Fix client stutter when crossing chunk boundaries
- Fix client freeze while fake chunks are being loaded (e.g. on join, after teleport, when moving around), they're now loaded in the background and will only appear once ready (instead of freezing the game until they are)
- Fix slow saving (which can then in turn be in the way when loading, causing that to be unbearably slow as well)

### 0.1.0
- Initial version
71 changes: 70 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
plugins {
id("fabric-loom") version "0.6-SNAPSHOT"
id("maven-publish")
id("com.github.breadmoirai.github-release") version "2.2.12"
id("com.matthewprenger.cursegradle") version "1.4.0"
id("com.modrinth.minotaur") version "1.1.0"
}

val modVersion: String by project
val mavenGroup: String by project
version = modVersion
group = mavenGroup

val minecraftVersion: String by project
val clothConfigVersion: String by project
val modMenuVersion: String by project

dependencies {
val minecraftVersion: String by project
val yarnMappings: String by project
val loaderVersion: String by project
val sodiumVersion: String by project
Expand Down Expand Up @@ -82,3 +85,69 @@ repositories {
}
}
}

fun readChangelog(): String {
val lines = project.file("CHANGELOG.md").readText().lineSequence().iterator()
if (lines.next() != "### ${project.version}") {
throw GradleException("CHANGELOG.md did not start with expected version!")
}
return lines.asSequence().takeWhile { it.isNotBlank() }.joinToString("\n")
}

githubRelease {
token { project.property("github.token") as String }
owner(project.property("github.owner") as String)
repo(project.property("github.repo") as String)
releaseName("Version ${project.version}")
releaseAssets(tasks.remapJar)
body(readChangelog())
}

curseforge {
// Would prefer to use lazy `project.property` but https://github.com/matthewprenger/CurseGradle/issues/32
apiKey = project.findProperty("curseforge.token") as String? ?: "DUMMY"
project(closureOf<com.matthewprenger.cursegradle.CurseProject> {
id = project.property("curseforge.id") as String
changelog = readChangelog()
releaseType = "release"
mainArtifact(tasks.remapJar.flatMap { it.archiveFile }, closureOf<com.matthewprenger.cursegradle.CurseArtifact> {
relations(closureOf<com.matthewprenger.cursegradle.CurseRelation> {
embeddedLibrary("confabricate")
optionalDependency("cloth-config")
optionalDependency("modmenu")
optionalDependency("sodium")
})
})
addGameVersion("Fabric")
addGameVersion(minecraftVersion)
addGameVersion("Java 8")
addGameVersion("Java 9")
addGameVersion("Java 10")
})
options(closureOf<com.matthewprenger.cursegradle.Options> {
javaVersionAutoDetect = false
javaIntegration = false
forgeGradleIntegration = false
})
}
tasks.withType<com.matthewprenger.cursegradle.CurseUploadTask> {
dependsOn(tasks.remapJar)
}

val publishModrinth by tasks.registering(com.modrinth.minotaur.TaskModrinthUpload::class) {
dependsOn(tasks.remapJar)
token = project.property("modrinth.token") as String
projectId = project.property("modrinth.id") as String
versionNumber = "${project.version}"
uploadFile = tasks.remapJar.flatMap { it.archiveFile }
changelog = readChangelog()
releaseType = "release"
addLoader("fabric")
addGameVersion(minecraftVersion)
}

val publishAll by tasks.registering {
dependsOn(tasks.curseforge)
dependsOn(tasks.githubRelease)
dependsOn(publishModrinth)
}
7 changes: 7 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@ org.gradle.jvmargs=-Xmx2G
modVersion = 1.1.4
mavenGroup = de.johni0702.minecraft
archivesBaseName = bobby
github.owner = johni0702
github.repo = bobby
curseforge.id = 409301
modrinth.id = M08ruV16
# github.token = ***
# curseforge.token = ***
# modrinth.token = ***

# Dependencies
confabricateVersion = 2.0.3
Expand Down

0 comments on commit 74990e6

Please sign in to comment.