Skip to content

Commit 77c244c

Browse files
committed
Re-add the github release task to the buildscript.
1 parent 8f258e4 commit 77c244c

3 files changed

Lines changed: 40 additions & 8 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
- Halplibe servers now maintain a list of vanilla clients connected to them.
2-
- Currently used to see if modded packets can be received by clients or if a compatibility packet should be used instead.
3-
- Vanilla clients no longer get kicked from modded servers if anyone in the server dies.
4-
- The somewhat new DeathCause API did this by sending a modded packet to all (even vanilla) clients.
5-
- A packet compatible with vanilla clients will be now sent instead.
6-
7-
Thanks to MelonMojito for this fix!
1+
- Make the client not crash instantly due to trying to load server classes.

build.gradle.kts

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
1+
import org.kohsuke.github.GHReleaseBuilder
2+
import org.kohsuke.github.GitHub
13
import java.nio.file.Files
24

5+
buildscript {
6+
7+
dependencies {
8+
classpath("org.kohsuke:github-api:1.135")
9+
}
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
}
15+
316
plugins {
417
alias(libs.plugins.loom)
518
alias(libs.plugins.minotaur)
@@ -163,6 +176,7 @@ publishing {
163176
}
164177

165178
val modrinthToken: Provider<String> = providers.gradleProperty("modrinthToken")
179+
val githubToken: Provider<String> = providers.gradleProperty("githubToken")
166180

167181
if (modrinthToken.isPresent) {
168182
modrinth {
@@ -202,3 +216,27 @@ fun resolveLwjglNatives(): String { // Sourced from https://www.lwjgl.org/
202216
}
203217
}
204218
}
219+
220+
if(githubToken.isPresent){
221+
tasks.register("github") {
222+
doLast {
223+
val github = GitHub.connectUsingOAuth(githubToken.get())
224+
val repository = github.getRepository("Turnip-Labs/bta-halplibe")
225+
226+
val releaseBuilder = GHReleaseBuilder(repository, version.toString())
227+
releaseBuilder.name("HalpLibe $version")
228+
releaseBuilder.body(Files.readString(rootProject.projectDir.toPath().resolve("CHANGELOG.md")))
229+
releaseBuilder.commitish("8.0")
230+
val release = releaseBuilder.create()
231+
release.uploadAsset(
232+
project.file(tasks.named("jar").get().outputs.files.singleFile),
233+
"application/java-archive"
234+
)
235+
release.uploadAsset(
236+
project.file(tasks.named("sourcesJar").get().outputs.files.singleFile),
237+
"application/java-archive"
238+
)
239+
}
240+
}
241+
242+
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ org.gradle.warning.mode = all
88
org.gradle.configuration-cache = false
99
##########################################################################
1010
# Mod Properties
11-
mod_version = 6.1.2
11+
mod_version = 6.1.3
1212
mod_group = turniplabs
1313
mod_name = halplibe
1414
##########################################################################

0 commit comments

Comments
 (0)