Skip to content
This repository was archived by the owner on Mar 19, 2025. It is now read-only.

Commit 9a1d3f6

Browse files
committed
Update dependencies, add auto publishing
1 parent 70a4ab3 commit 9a1d3f6

File tree

7 files changed

+139
-17
lines changed

7 files changed

+139
-17
lines changed

.github/workflows/build.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build
2+
on: [ push, pull_request ]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v4
8+
- uses: gradle/actions/wrapper-validation@v4
9+
- name: Set up JDK
10+
uses: actions/setup-java@v4
11+
with:
12+
distribution: temurin
13+
java-version: 17
14+
- name: Grant execute permission for gradlew
15+
run: chmod +x gradlew
16+
- name: Build with Gradle
17+
run: ./gradlew shadowJar --no-daemon

.github/workflows/release.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- '*.*.*'
6+
jobs:
7+
build:
8+
if: github.repository_owner == 'exaroton'
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: gradle/actions/wrapper-validation@v4
13+
- name: Set up JDK
14+
uses: actions/setup-java@v4
15+
with:
16+
distribution: temurin
17+
java-version: 17
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x gradlew
20+
- name: Build with Gradle
21+
run: ./gradlew shadowJar -Prelease=${{ github.ref_name }} --stacktrace
22+
- name: Publish to Maven Central
23+
env:
24+
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.EXAROTON_GPG_SIGNING_KEY }}
25+
ORG_GRADLE_PROJECT_SIGNING_PASSPHRASE: ${{ secrets.EXAROTON_GPG_SIGNING_PASSPHRASE }}
26+
ORG_GRADLE_PROJECT_OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
27+
ORG_GRADLE_PROJECT_OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
28+
run: ./gradlew publish -Prelease=${{ github.ref_name }} --stacktrace
29+
- name: Create Release
30+
uses: softprops/action-gh-release@v2
31+
with:
32+
files: |
33+
./build/libs/exaroton-bungeecord-*.jar
34+
body_path: ${{ github.workspace }}/CHANGELOG.md
35+
name: v${{ github.ref_name }}
36+
- name: Publish to Modrinth
37+
env:
38+
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
39+
run: ./gradlew modrinth -Prelease=${{ github.ref_name }} --stacktrace
40+
- name: Publish to Hangar
41+
env:
42+
HANGAR_TOKEN: ${{ secrets.HANGAR_TOKEN }}
43+
run: ./gradlew publishPluginPublicationToHangar -Prelease=${{ github.ref_name }} --stacktrace

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Update dependencies

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# exaroton BungeeCord Plugin
22
A BungeeCord plugin designed to use exaroton servers in your proxy network.
3-
This plugin can be used on proxies that don't run on exaroton as well.
3+
This plugin can also be used on proxies that don't run on exaroton.
44

55
## Setup
66
1. Install the plugin and start the server
@@ -50,5 +50,5 @@ You can call any actions in this plugin from your own BungeeCord plugin using th
5050

5151
Adding it to your gradle project:
5252
```
53-
implementation 'com.exaroton:bungee:1.4.0'
54-
```
53+
implementation 'com.exaroton:bungee:1.5.3'
54+
```

build.gradle

+72-13
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,63 @@
11
plugins {
22
id 'java-library'
3-
id 'com.github.johnrengelman.shadow' version '7.0.0'
43
id 'maven-publish'
54
id 'signing'
5+
id 'com.github.johnrengelman.shadow' version '7.0.0'
6+
id 'xyz.jpenilla.run-waterfall' version '2.3.1'
7+
id 'com.modrinth.minotaur' version '2.8.7'
8+
id 'io.papermc.hangar-publish-plugin' version '0.1.2'
69
}
710

811
group 'com.exaroton'
9-
version '1.5.2'
12+
13+
version = project.hasProperty('release') ? project.getProperty('release') : 'dev'
14+
java.sourceCompatibility = JavaVersion.VERSION_11
15+
java.targetCompatibility = JavaVersion.VERSION_11
1016

1117
repositories {
1218
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
1319
mavenCentral()
1420
}
1521

1622
dependencies {
17-
shadow group: 'net.md-5', name: 'bungeecord-api', version: '1.16-R0.5-SNAPSHOT'
23+
shadow "net.md-5:bungeecord-api:${minecraftVersion}-R0.1-SNAPSHOT"
1824
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
1925
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
20-
implementation 'com.exaroton:api:1.4.2'
26+
implementation 'com.exaroton:api:1.6.2'
2127
}
2228

23-
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
29+
ext.isReleaseVersion = project.version != "dev"
2430

2531
java {
2632
withJavadocJar()
2733
withSourcesJar()
2834
}
2935

36+
processResources {
37+
filter {
38+
it.replace('${project.version}', project.version)
39+
}
40+
}
41+
42+
shadowJar {
43+
archiveClassifier.set('')
44+
}
45+
46+
tasks {
47+
runWaterfall {
48+
waterfallVersion(minecraftVersion)
49+
}
50+
}
51+
3052
publishing {
3153
repositories {
3254
maven {
3355
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
3456
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
3557
url = isReleaseVersion ? releaseRepo : snapshotRepo
3658
credentials {
37-
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
38-
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
59+
username = findProperty('OSSRH_USERNAME')
60+
password = findProperty('OSSRH_PASSWORD')
3961
}
4062
}
4163
}
@@ -72,18 +94,55 @@ publishing {
7294
}
7395

7496
signing {
97+
def signingKey = findProperty("SIGNING_KEY").toString()
98+
def signingPassword = findProperty("SIGNING_PASSPHRASE").toString()
99+
useInMemoryPgpKeys(signingKey, signingPassword)
75100
sign publishing.publications.mavenJava
76101
}
102+
77103
tasks.withType(Sign) {
78104
onlyIf { isReleaseVersion }
79105
}
80106

81-
processResources {
82-
filter {
83-
it.replace('${project.version}', project.version)
84-
}
107+
modrinth {
108+
token = System.getenv("MODRINTH_TOKEN")
109+
projectId = "h9yHzOys"
110+
uploadFile = shadowJar
111+
gameVersions = [
112+
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4",
113+
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6",
114+
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
115+
"1.18", "1.18.1", "1.18.2",
116+
"1.17", "1.17.1",
117+
"1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
118+
"1.15", "1.15.1", "1.15.2",
119+
"1.14", "1.14.1", "1.14.2", "1.14.3", "1.14.4",
120+
"1.13", "1.13.1", "1.13.2",
121+
"1.12", "1.12.1", "1.12.2",
122+
"1.11", "1.11.1", "1.11.2",
123+
"1.10", "1.10.1", "1.10.2",
124+
"1.9", "1.9.1", "1.9.2", "1.9.3", "1.9.4",
125+
"1.8", "1.8.1", "1.8.2", "1.8.3", "1.8.4", "1.8.5", "1.8.6", "1.8.7", "1.8.8", "1.8.9",
126+
"1.7", "1.7.1", "1.7.2", "1.7.3", "1.7.4", "1.7.5", "1.7.6", "1.7.7", "1.7.8", "1.7.9", "1.7.10"
127+
]
128+
loaders = ["bungeecord", "waterfall"]
129+
changelog = rootProject.file("CHANGELOG.md").text
85130
}
86131

87-
shadowJar {
88-
archiveClassifier.set('')
132+
hangarPublish {
133+
publications.register("plugin") {
134+
version.set(project.version as String)
135+
channel.set("Release")
136+
id.set("exaroton-proxy-plugin")
137+
apiKey.set(System.getenv("HANGAR_TOKEN"))
138+
platforms {
139+
register(io.papermc.hangarpublishplugin.model.Platforms.WATERFALL) {
140+
// Set the JAR file to upload
141+
jar.set(tasks.shadowJar.outputs.files.singleFile)
142+
143+
platformVersions.set(project.hangarWaterfallVersions.split(",").collect { it.trim() })
144+
changelog.set(rootProject.file("CHANGELOG.md").text)
145+
}
146+
}
147+
}
89148
}

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minecraftVersion=1.19
2+
hangarWaterfallVersions=1.21,1.20,1.19,1.18,1.17,1.16,1.15,1.14,1.13,1.12,1.11
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)