Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 44 additions & 31 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
name: Build

on:
release:
types: [published]
workflow_dispatch:
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
cache: maven
server-id: central
server-username: CENTRAL_USERNAME
server-password: CENTRAL_TOKEN
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Initialize Paper NMS
run: for file in $(grep -l '<artifactId>paper-nms</artifactId>' $(find -name 'pom.xml')); do mvn -B paper-nms:init --file "$file"; done

- name: Build the dependencies of the api
run: mvn -B install --file pom.xml -pl '!api'

- name: Build and deploy the api
working-directory: ./api
run: mvn -B deploy --file pom.xml
env:
CENTRAL_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
CENTRAL_TOKEN: ${{ secrets.CENTRAL_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- uses: actions/checkout@v4

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Set up JDK 21 and 25
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
21
25
cache: gradle

- name: Build with Gradle
run: chmod +x gradlew && ./gradlew shadowJar -x test --no-daemon

- name: Upload SignGUI jar
uses: actions/upload-artifact@v4
with:
name: signgui-build
path: build/libs/signgui-*.jar
if-no-files-found: error

- name: Publish snapshot to Reposilite
if: github.event_name == 'push'
run: |
VERSION=$(./gradlew -q printVersion)
echo "Project version: $VERSION"
if [[ "$VERSION" != *-SNAPSHOT ]]; then
echo "Not a SNAPSHOT version — skipping snapshot publish."
exit 0
fi
if [ -z "${REPOSILITE_USER}" ] || [ -z "${REPOSILITE_TOKEN}" ]; then
echo "Missing REPOSILITE_USER / REPOSILITE_TOKEN secrets."
exit 1
fi
./gradlew publishSnapshot -x test --no-daemon
env:
REPOSILITE_USER: ${{ secrets.REPOSILITE_USER }}
REPOSILITE_TOKEN: ${{ secrets.REPOSILITE_TOKEN }}
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release

on:
workflow_dispatch:
inputs:
tag:
description: "Git tag to create/publish (e.g. v2.6.1). Leave empty to use project version."
required: false
default: ""

permissions:
contents: write

jobs:
release:
name: Publish Release
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v4

- name: Set up JDK 21 and 25
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: |
21
25
cache: gradle

- name: Resolve version / tag
id: meta
run: |
PROJECT_VERSION="$(./gradlew -q printVersion)"
TAG_INPUT="${{ github.event.inputs.tag }}"
if [ -n "$TAG_INPUT" ]; then
TAG="$TAG_INPUT"
else
TAG="v${PROJECT_VERSION}"
fi
echo "version=${PROJECT_VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Resolved tag=${TAG} version=${PROJECT_VERSION}"

- name: Build publishable artifacts
run: chmod +x gradlew && ./gradlew clean shadowJar -x test --no-daemon

- name: Publish release to Reposilite
run: |
if [ -z "${REPOSILITE_USER}" ] || [ -z "${REPOSILITE_TOKEN}" ]; then
echo "Missing REPOSILITE_USER / REPOSILITE_TOKEN secrets."
exit 1
fi
./gradlew publish -x test --no-daemon
env:
REPOSILITE_USER: ${{ secrets.REPOSILITE_USER }}
REPOSILITE_TOKEN: ${{ secrets.REPOSILITE_TOKEN }}

- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.meta.outputs.tag }}
name: ${{ steps.meta.outputs.tag }}
generate_release_notes: true
files: |
build/libs/signgui-*.jar
49 changes: 41 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,41 @@
.idea/
*.iml
target/
test/
dependency-reduced-pom.xml
.mvn/
.flattened-pom.xml
.paper-nms/
# Gradle
.gradle
*.bat
*.log
**/build/
!src/**/build/
bin/*
*.class

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Avoid ignore Gradle wrappper properties
!gradle-wrapper.properties

# Cache of project
.gradletasknamecache

# Eclipse Gradle plugin generated files
# Eclipse Core
.project

# JDT-specific (Eclipse Java Development Tools)
.classpath

# MkDocs GitLab Pages output
/public/

#Obfuscation
/libs
/skidfuscator/mappings
*.txt
!docs-requirements.txt
/skidfuscator/libs
/mappings
/wrapper
/.paper-nms
*.salive
3 changes: 3 additions & 0 deletions 1_10_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("spigot")
}
32 changes: 0 additions & 32 deletions 1_10_R1/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -92,7 +91,7 @@ protected void decode(ChannelHandlerContext chc, Packet<?> packet, List<Object>
};

if (schedule)
SCHEDULER.schedule(runnable, 200, TimeUnit.MILLISECONDS);
scheduleReopen(player, loc, runnable);
else
runnable.run();
}
Expand Down
3 changes: 3 additions & 0 deletions 1_11_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("spigot")
}
32 changes: 0 additions & 32 deletions 1_11_R1/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -92,7 +91,7 @@ protected void decode(ChannelHandlerContext chc, Packet<?> packet, List<Object>
};

if (schedule)
SCHEDULER.schedule(runnable, 200, TimeUnit.MILLISECONDS);
scheduleReopen(player, loc, runnable);
else
runnable.run();
}
Expand Down
3 changes: 3 additions & 0 deletions 1_12_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("spigot")
}
32 changes: 0 additions & 32 deletions 1_12_R1/pom.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;

@SuppressWarnings("deprecation")
Expand Down Expand Up @@ -92,7 +91,7 @@ protected void decode(ChannelHandlerContext chc, Packet<?> packet, List<Object>
};

if (schedule)
SCHEDULER.schedule(runnable, 200, TimeUnit.MILLISECONDS);
scheduleReopen(player, loc, runnable);
else
runnable.run();
}
Expand Down
3 changes: 3 additions & 0 deletions 1_13_R1/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
id("spigot")
}
Loading