Skip to content

Commit 5947b6a

Browse files
Switch to new custom Reposilite Maven repo
1 parent 63f7b54 commit 5947b6a

6 files changed

Lines changed: 81 additions & 42 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout sources
13+
uses: actions/checkout@v6
14+
- name: Setup Java
15+
uses: actions/setup-java@v5
16+
with:
17+
distribution: 'temurin'
18+
java-version: 25
19+
- name: Setup Gradle
20+
uses: gradle/actions/setup-gradle@v6
21+
- name: Build and Publish with Gradle
22+
env:
23+
REPOSILITE_USERNAME: ${{ secrets.REPOSILITE_USERNAME }}
24+
REPOSILITE_TOKEN: ${{ secrets.REPOSILITE_TOKEN }}
25+
run: |
26+
./gradlew publish \
27+
-PreposiliteUsername="$REPOSILITE_USERNAME" \
28+
-PreposilitePassword="$REPOSILITE_TOKEN"

‎.github/workflows/trigger-jitpack-build.yml‎

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

‎build.gradle.kts‎

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import java.text.SimpleDateFormat
2+
import java.util.*
3+
14
plugins {
25
id("server.common-conventions")
36
id("com.gradleup.shadow") version "9.4.0"
@@ -7,13 +10,12 @@ plugins {
710
}
811

912
group = "com.bluedragonmc"
10-
version = "1.0-SNAPSHOT"
13+
version = getPublishingVersion()
1114

1215
repositories {
1316
mavenLocal()
1417
mavenCentral()
15-
maven(url = "https://jitpack.io")
16-
maven("https://reposilite.atlasengine.ca/public")
18+
maven(url = "https://reposilite.bluedragonmc.com/releases")
1719
}
1820

1921
dependencies {
@@ -62,16 +64,15 @@ fun getOutputOf(command: String): String? {
6264
}
6365
}
6466

65-
publishing {
66-
publications {
67-
create<MavenPublication>("maven") {
68-
groupId = "com.bluedragonmc"
69-
artifactId = "Server"
70-
version = "1.0"
67+
fun isInCI() = System.getenv("CI") != null
7168

72-
from(components["java"])
73-
}
74-
}
69+
fun getPublishingVersion(): String = if (isInCI()) {
70+
val commitSha = getOutputOf("git rev-parse --verify --short HEAD")
71+
val date = SimpleDateFormat("YYYY-MM-dd").format(Date())
72+
73+
"$date-$commitSha"
74+
} else {
75+
"dev"
7576
}
7677

7778
kotlin {
@@ -94,4 +95,4 @@ tasks.jar {
9495
manifest {
9596
attributes["Main-Class"] = "com.bluedragonmc.server.ServerKt"
9697
}
97-
}
98+
}

‎common/build.gradle.kts‎

Lines changed: 31 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
plugins {
22
id("server.common-conventions")
3+
id("org.jetbrains.dokka-javadoc") version "2.2.0"
34
kotlin("plugin.serialization") version "2.3.0"
45
`maven-publish`
56
}
67

78
group = "com.bluedragonmc.server"
8-
version = "1.0-SNAPSHOT"
9+
version = rootProject.version
910

1011
repositories {
1112
mavenLocal()
1213
mavenCentral()
13-
maven(url = "https://jitpack.io")
14-
maven("https://reposilite.atlasengine.ca/public")
14+
maven(url = "https://reposilite.bluedragonmc.com/releases")
1515
}
1616

1717
dependencies {
@@ -27,14 +27,41 @@ dependencies {
2727
implementation(libs.fastutil)
2828
}
2929

30+
val sourcesJar by tasks.registering(Jar::class) {
31+
archiveClassifier.set("sources")
32+
from(sourceSets.main.get().allSource)
33+
}
34+
35+
val javadocJar by tasks.registering(Jar::class) {
36+
archiveClassifier.set("javadoc")
37+
from(tasks.dokkaGeneratePublicationJavadoc.flatMap { it.outputDirectory })
38+
archiveClassifier.set("javadoc")
39+
}
40+
3041
publishing {
42+
val rootVersion = rootProject.version.toString()
43+
val inCI = rootVersion != "dev"
44+
repositories {
45+
if (inCI) {
46+
maven {
47+
name = "reposilite"
48+
url = uri("https://reposilite.bluedragonmc.com/releases")
49+
credentials(PasswordCredentials::class)
50+
authentication {
51+
create<BasicAuthentication>("basic")
52+
}
53+
}
54+
}
55+
}
3156
publications {
3257
create<MavenPublication>("maven") {
3358
groupId = "com.bluedragonmc.server"
3459
artifactId = "common"
35-
version = "1.0"
60+
version = rootVersion
3661

3762
from(components["java"])
63+
artifact(sourcesJar)
64+
artifact(javadocJar)
3865
}
3966
}
4067
}

‎gradle/libs.versions.toml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ metadata.format.version = "1.1"
33
[versions]
44
kotlin = "2.3.0"
55
minestom = "2026.03.25-1.21.11"
6-
jukebox = "a941945c86"
6+
jukebox = "2026-06-13-3d8993c"
77
configurate = "4.2.0"
88
minimessage = "4.19.0"
99
kmongo = "5.2.1"
1010
caffeine = "3.2.0"
1111
okhttp = "4.12.0"
1212
serialization = "1.8.0"
1313
tinylog = "2.7.0"
14-
atlas-projectiles = "2.1.2"
14+
atlas-projectiles = "2.1.5"
1515
fastutil = "8.5.18"
1616
polar = "1.15.1"
1717
# Auto-generated GRPC/Protobuf messaging code
18-
rpc = "aee4852ca5"
18+
rpc = "2026-06-13-f05505c"
1919
# Messaging dependencies
2020
grpc = "1.71.0"
2121
grpc-kotlin-stub = "1.4.1"
@@ -27,8 +27,8 @@ junit = "5.9.0"
2727
[libraries]
2828
kotlin-jvm = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
2929
minestom = { group = "net.minestom", name = "minestom", version.ref = "minestom" }
30-
jukebox = { group = "com.github.BlueDragonMC", name = "Jukebox", version.ref = "jukebox" }
31-
#jukebox = { group = "com.bluedragonmc", name = "Jukebox", version = "1.0-SNAPSHOT" }
30+
jukebox = { group = "com.bluedragonmc", name = "jukebox", version.ref = "jukebox" }
31+
#jukebox = { group = "com.bluedragonmc", name = "jukebox", version = "dev" }
3232
configurate-yaml = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
3333
configurate-gson = { group = "org.spongepowered", name = "configurate-gson", version.ref = "configurate" }
3434
configurate-extra-kotlin = { group = "org.spongepowered", name = "configurate-extra-kotlin", version.ref = "configurate" }
@@ -39,8 +39,8 @@ kmongo = { group = "org.litote.kmongo", name = "kmongo-coroutine-serialization",
3939
serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "serialization" }
4040
caffeine = { group = "com.github.ben-manes.caffeine", name = "caffeine", version.ref = "caffeine" }
4141
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }
42-
rpc = { group = "com.github.BlueDragonMC", name = "RPC", version.ref = "rpc" }
43-
#rpc = { group = "com.bluedragonmc", name = "rpc", version = "1.0" }
42+
rpc = { group = "com.bluedragonmc", name = "rpc", version.ref = "rpc" }
43+
#rpc = { group = "com.bluedragonmc", name = "rpc", version = "dev" }
4444
grpc-protobuf = { group = "io.grpc", name = "grpc-protobuf", version.ref = "grpc" }
4545
grpc-netty = { group = "io.grpc", name = "grpc-netty", version.ref = "grpc" }
4646
grpc-kotlin-stub = { group = "io.grpc", name = "grpc-kotlin-stub", version.ref = "grpc-kotlin-stub" }
@@ -57,4 +57,4 @@ polar = { group = "dev.hollowcube", name = "polar", version.ref = "polar"}
5757
[bundles]
5858
configurate = ["configurate-yaml", "configurate-gson", "configurate-extra-kotlin"]
5959
messaging = ["rpc", "grpc-protobuf", "grpc-netty", "grpc-kotlin-stub", "protobuf-kotlin"]
60-
tinylog = ["tinylog-api", "tinylog-impl", "tinylog-slf4j"]
60+
tinylog = ["tinylog-api", "tinylog-impl", "tinylog-slf4j"]

‎jitpack.yml‎

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

0 commit comments

Comments
 (0)