Skip to content

Commit 5a6f6d7

Browse files
authored
Remove CurseForge related actions (#208)
* Remove CurseForge versions updater * Remove CurseForge release action
1 parent 8098e58 commit 5a6f6d7

4 files changed

Lines changed: 0 additions & 163 deletions

File tree

.github/workflows/curseforge.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/update-versions-cf.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

VERSIONS_CF.txt

Lines changed: 0 additions & 56 deletions
This file was deleted.

build.gradle.kts

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,3 @@
1-
import java.net.URI
2-
import java.net.http.HttpRequest
3-
41
plugins {
52
base
63
}
7-
8-
9-
10-
tasks {
11-
register("updateVersionsCf") {
12-
doLast {
13-
val token = System.getenv("CURSEFORGE_TOKEN") ?: throw RuntimeException("missing CurseForge token")
14-
val response = jsonRequest(
15-
HttpRequest.newBuilder()
16-
.uri(URI("https://api.curseforge.com/v1/minecraft/version"))
17-
.header("X-Api-Token", token)
18-
.build()
19-
)
20-
assert(response.statusCode() == 200) { "Invalid status code (${response.statusCode()})" }
21-
val versions = response.body()["data"].associate {
22-
it["versionString"].asText() to it["gameVersionId"].asInt()
23-
}
24-
project.file("VERSIONS.txt").reader().use { reader ->
25-
project.file("VERSIONS_CF.txt").writer().use { writer ->
26-
reader.useLines { lines ->
27-
for (version in lines) {
28-
val versionId = versions[version]
29-
if (versionId != null) {
30-
writer.write("$versionId\n")
31-
}
32-
}
33-
}
34-
}
35-
}
36-
}
37-
}
38-
}

0 commit comments

Comments
 (0)