Skip to content

Commit

Permalink
Update dependencies, add auto publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianVennen committed Jan 9, 2025
1 parent 70a4ab3 commit 9a1d3f6
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 17 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Build
on: [ push, pull_request ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew shadowJar --no-daemon
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
on:
push:
tags:
- '*.*.*'
jobs:
build:
if: github.repository_owner == 'exaroton'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/actions/wrapper-validation@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew shadowJar -Prelease=${{ github.ref_name }} --stacktrace
- name: Publish to Maven Central
env:
ORG_GRADLE_PROJECT_SIGNING_KEY: ${{ secrets.EXAROTON_GPG_SIGNING_KEY }}
ORG_GRADLE_PROJECT_SIGNING_PASSPHRASE: ${{ secrets.EXAROTON_GPG_SIGNING_PASSPHRASE }}
ORG_GRADLE_PROJECT_OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
run: ./gradlew publish -Prelease=${{ github.ref_name }} --stacktrace
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
./build/libs/exaroton-bungeecord-*.jar
body_path: ${{ github.workspace }}/CHANGELOG.md
name: v${{ github.ref_name }}
- name: Publish to Modrinth
env:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
run: ./gradlew modrinth -Prelease=${{ github.ref_name }} --stacktrace
- name: Publish to Hangar
env:
HANGAR_TOKEN: ${{ secrets.HANGAR_TOKEN }}
run: ./gradlew publishPluginPublicationToHangar -Prelease=${{ github.ref_name }} --stacktrace
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update dependencies
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# exaroton BungeeCord Plugin
A BungeeCord plugin designed to use exaroton servers in your proxy network.
This plugin can be used on proxies that don't run on exaroton as well.
This plugin can also be used on proxies that don't run on exaroton.

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

Adding it to your gradle project:
```
implementation 'com.exaroton:bungee:1.4.0'
```
implementation 'com.exaroton:bungee:1.5.3'
```
85 changes: 72 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,41 +1,63 @@
plugins {
id 'java-library'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'maven-publish'
id 'signing'
id 'com.github.johnrengelman.shadow' version '7.0.0'
id 'xyz.jpenilla.run-waterfall' version '2.3.1'
id 'com.modrinth.minotaur' version '2.8.7'
id 'io.papermc.hangar-publish-plugin' version '0.1.2'
}

group 'com.exaroton'
version '1.5.2'

version = project.hasProperty('release') ? project.getProperty('release') : 'dev'
java.sourceCompatibility = JavaVersion.VERSION_11
java.targetCompatibility = JavaVersion.VERSION_11

repositories {
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
mavenCentral()
}

dependencies {
shadow group: 'net.md-5', name: 'bungeecord-api', version: '1.16-R0.5-SNAPSHOT'
shadow "net.md-5:bungeecord-api:${minecraftVersion}-R0.1-SNAPSHOT"
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.2'
implementation 'com.exaroton:api:1.4.2'
implementation 'com.exaroton:api:1.6.2'
}

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
ext.isReleaseVersion = project.version != "dev"

java {
withJavadocJar()
withSourcesJar()
}

processResources {
filter {
it.replace('${project.version}', project.version)
}
}

shadowJar {
archiveClassifier.set('')
}

tasks {
runWaterfall {
waterfallVersion(minecraftVersion)
}
}

publishing {
repositories {
maven {
def releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
def snapshotRepo = "https://s01.oss.sonatype.org/content/repositories/snapshots/"
url = isReleaseVersion ? releaseRepo : snapshotRepo
credentials {
username = project.hasProperty('ossrhUsername') ? ossrhUsername : "Unknown user"
password = project.hasProperty('ossrhPassword') ? ossrhPassword : "Unknown password"
username = findProperty('OSSRH_USERNAME')
password = findProperty('OSSRH_PASSWORD')
}
}
}
Expand Down Expand Up @@ -72,18 +94,55 @@ publishing {
}

signing {
def signingKey = findProperty("SIGNING_KEY").toString()
def signingPassword = findProperty("SIGNING_PASSPHRASE").toString()
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}

processResources {
filter {
it.replace('${project.version}', project.version)
}
modrinth {
token = System.getenv("MODRINTH_TOKEN")
projectId = "h9yHzOys"
uploadFile = shadowJar
gameVersions = [
"1.21", "1.21.1", "1.21.2", "1.21.3", "1.21.4",
"1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4", "1.20.5", "1.20.6",
"1.19", "1.19.1", "1.19.2", "1.19.3", "1.19.4",
"1.18", "1.18.1", "1.18.2",
"1.17", "1.17.1",
"1.16", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
"1.15", "1.15.1", "1.15.2",
"1.14", "1.14.1", "1.14.2", "1.14.3", "1.14.4",
"1.13", "1.13.1", "1.13.2",
"1.12", "1.12.1", "1.12.2",
"1.11", "1.11.1", "1.11.2",
"1.10", "1.10.1", "1.10.2",
"1.9", "1.9.1", "1.9.2", "1.9.3", "1.9.4",
"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",
"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"
]
loaders = ["bungeecord", "waterfall"]
changelog = rootProject.file("CHANGELOG.md").text
}

shadowJar {
archiveClassifier.set('')
hangarPublish {
publications.register("plugin") {
version.set(project.version as String)
channel.set("Release")
id.set("exaroton-proxy-plugin")
apiKey.set(System.getenv("HANGAR_TOKEN"))
platforms {
register(io.papermc.hangarpublishplugin.model.Platforms.WATERFALL) {
// Set the JAR file to upload
jar.set(tasks.shadowJar.outputs.files.singleFile)

platformVersions.set(project.hangarWaterfallVersions.split(",").collect { it.trim() })
changelog.set(rootProject.file("CHANGELOG.md").text)
}
}
}
}
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minecraftVersion=1.19
hangarWaterfallVersions=1.21,1.20,1.19,1.18,1.17,1.16,1.15,1.14,1.13,1.12,1.11
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 9a1d3f6

Please sign in to comment.