Skip to content

Commit abe2627

Browse files
committed
cloud port, server switcher not yet implemented
1 parent e41e8b6 commit abe2627

File tree

112 files changed

+685
-3868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+685
-3868
lines changed

.github/workflows/publish.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Publish to Maven & Create GitHub Release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'version/*'
7+
workflow_dispatch:
8+
9+
env:
10+
SLNE_SNAPSHOTS_REPO_USERNAME: ${{ secrets.SLNE_SNAPSHOTS_REPO_USERNAME }}
11+
SLNE_SNAPSHOTS_REPO_PASSWORD: ${{ secrets.SLNE_SNAPSHOTS_REPO_PASSWORD }}
12+
SLNE_RELEASES_REPO_USERNAME: ${{ secrets.SLNE_RELEASES_REPO_USERNAME }}
13+
SLNE_RELEASES_REPO_PASSWORD: ${{ secrets.SLNE_RELEASES_REPO_PASSWORD }}
14+
MODULE_REGEX: "surf-lobby-bukkit-lobby.*-all\\.jar$|surf-lobby-bukkit-server.*-all\\.jar$"
15+
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
environment: production
21+
steps:
22+
- name: Collect Workflow Telemetry
23+
uses: catchpoint/workflow-telemetry-action@v2
24+
25+
- name: Checkout Repository
26+
uses: actions/checkout@v4
27+
with:
28+
fetch-depth: 0
29+
30+
- name: Cache Gradle packages
31+
uses: actions/cache@v3
32+
with:
33+
path: |
34+
~/.gradle/caches
35+
~/.gradle/wrapper
36+
key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
37+
restore-keys: gradle-${{ runner.os }}-
38+
39+
- name: Setup JDK
40+
uses: actions/setup-java@v4
41+
with:
42+
distribution: 'graalvm'
43+
java-version: '24'
44+
45+
- name: Build all modules with Gradle
46+
run: ./gradlew build shadowJar --parallel --no-scan
47+
48+
- name: Publish all modules to Maven
49+
run: ./gradlew publish --parallel --no-scan
50+
51+
- name: Extract Project Version and Snapshot Flag from Gradle
52+
id: get_version
53+
run: |
54+
VERSION=$(./gradlew properties --no-daemon \
55+
| grep '^version:' \
56+
| awk '{print $2}')
57+
SNAPSHOT_FLAG=$(./gradlew properties --no-daemon \
58+
| grep '^snapshot:' \
59+
| awk '{print $2}')
60+
if [ "$SNAPSHOT_FLAG" = "true" ]; then
61+
VERSION="${VERSION}-SNAPSHOT"
62+
fi
63+
echo "VERSION=$VERSION" >> $GITHUB_ENV
64+
echo "SNAPSHOT_FLAG=$SNAPSHOT_FLAG" >> $GITHUB_ENV
65+
66+
- name: Determine release flags
67+
run: |
68+
CURRENT_BRANCH=${GITHUB_REF#refs/heads/}
69+
# prerelease only for snapshots
70+
if [ "${SNAPSHOT_FLAG}" = "true" ]; then
71+
echo "PRERELEASE=true" >> $GITHUB_ENV
72+
else
73+
echo "PRERELEASE=false" >> $GITHUB_ENV
74+
fi
75+
# make_latest false for snapshots or non-default branches
76+
if [ "${SNAPSHOT_FLAG}" = "true" ] || [ "${CURRENT_BRANCH}" != "${DEFAULT_BRANCH}" ]; then
77+
echo "MAKE_LATEST=false" >> $GITHUB_ENV
78+
else
79+
echo "MAKE_LATEST=true" >> $GITHUB_ENV
80+
fi
81+
82+
- name: Find and filter JAR files
83+
id: find_jars
84+
run: |
85+
echo "JAR_FILES<<EOF" >> $GITHUB_ENV
86+
find . -path "**/build/libs/*.jar" \
87+
| grep -E "${{ env.MODULE_REGEX }}" \
88+
>> $GITHUB_ENV
89+
echo "EOF" >> $GITHUB_ENV
90+
91+
- name: Create GitHub Release
92+
uses: softprops/action-gh-release@v2
93+
with:
94+
tag_name: v${{ env.VERSION }}
95+
name: Release ${{ env.VERSION }}
96+
draft: false
97+
prerelease: ${{ env.PRERELEASE }}
98+
make_latest: ${{ env.MAKE_LATEST }}
99+
files: ${{ env.JAR_FILES }}
100+
generate_release_notes: true
101+
env:
102+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
*.iml
4040
.idea/modules
4141
*.ipr
42+
.idea/
4243

4344
# CMake
4445
cmake-build-*/

.idea/modules.xml

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/surf-lobby-bukkit/surf-lobby-bukkit-lobby/dev.slne.surf.surf-lobby.surf-lobby-bukkit.surf-lobby-bukkit-lobby.main.iml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build.gradle.kts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import dev.slne.surf.surfapi.gradle.util.slnePrivate
2-
31
buildscript {
42
repositories {
53
gradlePluginPortal()
@@ -12,9 +10,5 @@ buildscript {
1210

1311
allprojects {
1412
group = "dev.slne.surf"
15-
version = "1.21.7-1.4.0-SNAPSHOT"
16-
17-
repositories {
18-
slnePrivate()
19-
}
13+
version = findProperty("version") as String
2014
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
kotlin.code.style=official
22
kotlin.stdlib.default.dependency=false
33
org.gradle.parallel=true
4-
org.gradle.jvmargs=-Xmx4096m
4+
version=1.21.8-2.0.0-SNAPSHOT

gradle/libs.versions.toml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
11
[versions]
2-
dev-slne-data-api-version = "1.21+"
3-
dev-slne-surf-proxy-api-version = "1.21+"
4-
net-luckperms-api-version = "5.4"
5-
nexo = "1.9.0"
6-
org-apache-commons-commons-collections4-version = "4.5.0"
2+
nexo = "1.10.0"
73

84
[libraries]
9-
dev-slne-data-api = { module = "dev.slne:surf-data-api", version.ref = "dev-slne-data-api-version" }
10-
dev-slne-surf-proxy-api = { module = "dev.slne.surf.proxy:surf-proxy-api", version.ref = "dev-slne-surf-proxy-api-version" }
11-
net-luckperms-api = { module = "net.luckperms:api", version.ref = "net-luckperms-api-version" }
125
nexo = { module = "com.nexomc:nexo", version.ref = "nexo" }
13-
org-apache-commons-commons-collections4 = { module = "org.apache.commons:commons-collections4", version.ref = "org-apache-commons-commons-collections4-version" }

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

100644100755
File mode changed.

settings.gradle.kts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,6 @@
1-
pluginManagement {
2-
repositories {
3-
gradlePluginPortal()
4-
maven("https://repo.slne.dev/repository/maven-public/") { name = "maven-public" }
5-
}
6-
}
7-
81
rootProject.name = "surf-lobby"
92

10-
// Core
11-
include(":surf-lobby-api")
12-
include(":surf-lobby-core")
13-
14-
// Velocity
15-
include(":surf-lobby-velocity")
16-
173
// Bukkit
18-
include(":surf-lobby-bukkit")
194
include(":surf-lobby-bukkit:surf-lobby-bukkit-common")
205
include(":surf-lobby-bukkit:surf-lobby-bukkit-server")
216
include(":surf-lobby-bukkit:surf-lobby-bukkit-lobby")

0 commit comments

Comments
 (0)