Skip to content

Commit f44a3a3

Browse files
authored
Minor config changes (#14)
* Minor config changes * New build workflow + small config change * Oops...
1 parent bf6774b commit f44a3a3

File tree

7 files changed

+101
-57
lines changed

7 files changed

+101
-57
lines changed

.github/workflows/build.yml

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,67 @@
11
name: Java CI with Gradle
22

3-
on: [ push ]
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
410

511
jobs:
612
build:
713
runs-on: ubuntu-latest
814
steps:
915
- name: Checkout
10-
uses: actions/checkout@v2.3.5
11-
- name: Set up JDK 11
12-
uses: actions/setup-java@v2.3.1
16+
uses: actions/checkout@v3.0.0
17+
- name: Set up JDK
18+
uses: actions/setup-java@v3.0.0
1319
with:
1420
distribution: adopt
1521
java-version: 11
16-
- name: Cache gradle
17-
uses: actions/[email protected]
18-
with:
19-
path: |
20-
~/.gradle/caches
21-
~/.gradle/wrapper
22-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
23-
restore-keys: ${{ runner.os }}-gradle-
24-
- name: Build
22+
- name: Build VelocityTools
2523
run: ./gradlew build
26-
- name: Upload a build artifact
27-
uses: actions/upload-artifact@v2.2.4
24+
- name: Upload VelocityTools
25+
uses: actions/upload-artifact@v3.0.0
2826
with:
2927
name: VelocityTools
30-
path: build/libs/velocity_tools-*.jar
28+
path: "*/build/libs/*.jar"
3129
- uses: dev-drprasad/[email protected]
30+
if: ${{ github.event_name == 'push' }}
3231
with:
3332
delete_release: true
3433
tag_name: dev-build
3534
env:
3635
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Find git version
37+
id: git-version
38+
run: echo "id=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
39+
- name: Find correct JAR
40+
if: ${{ github.event_name == 'push' }}
41+
id: find-jar
42+
run: |
43+
output="$(find plugin/build/libs/ ! -name "*-javadoc.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
44+
echo "::set-output name=jarname::$output"
3745
- name: Release the build
46+
if: ${{ github.event_name == 'push' }}
3847
uses: ncipollo/release-action@v1
3948
with:
40-
artifacts: "build/libs/velocity_tools-*.jar"
49+
artifacts: plugin/build/libs/${{ steps.find-jar.outputs.jarname }}
4150
body: ${{ join(github.event.commits.*.message, '\n') }}
4251
prerelease: true
43-
name: Dev-build
52+
name: Dev-build ${{ steps.git-version.outputs.id }}
4453
tag: dev-build
54+
- name: Upload to Modrinth
55+
if: ${{ github.event_name == 'push' }}
56+
uses: RubixDev/[email protected]
57+
with:
58+
token: ${{ secrets.MODRINTH_TOKEN }}
59+
file_path: plugin/build/libs/${{ steps.find-jar.outputs.jarname }}
60+
name: Dev-build ${{ steps.git-version.outputs.id }}
61+
version: ${{ steps.git-version.outputs.id }}
62+
changelog: ${{ join(github.event.commits.*.message, '\n') }}
63+
game_versions: 1.7.2
64+
release_type: beta
65+
loaders: velocity
66+
featured: false
67+
project_id: 4mehh1CR

.github/workflows/release.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Java CI with Gradle
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/[email protected]
13+
- name: Set up JDK
14+
uses: actions/[email protected]
15+
with:
16+
distribution: adopt
17+
java-version: 11
18+
- name: Build VelocityTools
19+
run: ./gradlew build
20+
- name: Upload VelocityTools
21+
uses: actions/[email protected]
22+
with:
23+
name: VelocityTools
24+
path: "*/build/libs/*.jar"
25+
- name: Find correct JAR
26+
id: find-jar
27+
run: |
28+
output="$(find plugin/build/libs/ ! -name "*-javadoc.jar" ! -name "*-sources.jar" -type f -printf "%f\n")"
29+
echo "::set-output name=jarname::$output"
30+
- name: Upload to the GitHub release
31+
uses: actions/upload-release-asset@v1
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
upload_url: ${{ github.event.release.upload_url }}
36+
asset_path: plugin/build/libs/${{ steps.find-jar.outputs.jarname }}
37+
asset_name: ${{ steps.find-jar.outputs.jarname }}
38+
asset_content_type: application/java-archive
39+
- name: Upload to Modrinth
40+
uses: RubixDev/[email protected]
41+
with:
42+
token: ${{ secrets.MODRINTH_TOKEN }}
43+
file_path: plugin/build/libs/${{ steps.find-jar.outputs.jarname }}
44+
name: Release ${{ github.event.release.tag_name }}
45+
version: ${{ github.event.release.tag_name }}
46+
changelog: ${{ github.event.release.body }}
47+
game_versions: 1.7.2
48+
release_type: release
49+
loaders: velocity
50+
featured: true
51+
project_id: 4mehh1CR

.github/workflows/test.yml

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

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.8
1+
1.1.9

build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
plugins {
44
id("java")
55
id("checkstyle")
6-
id("com.github.spotbugs").version("5.0.3")
6+
id("com.github.spotbugs").version("5.0.13")
77
id("org.cadixdev.licenser").version("0.6.1")
8-
id("com.github.johnrengelman.shadow").version("7.0.0")
8+
id("com.github.johnrengelman.shadow").version("7.1.2")
99
}
1010

1111
setGroup("net.elytrium")
12-
setVersion("1.1.8")
12+
setVersion("1.1.9")
1313

1414
compileJava {
1515
getOptions().setEncoding("UTF-8")
Lines changed: 1 addition & 1 deletion
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.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/net/elytrium/velocitytools/Settings.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public static class BRAND_CHANGER {
171171

172172
public boolean REWRITE_IN_PING = true;
173173
public boolean REWRITE_IN_GAME = true;
174-
public String PING_BRAND = "YourServer 1.12.2-1.17.1";
174+
public String PING_BRAND = "YourServer 1.12.2-1.19.3";
175175
@Comment("For ping.")
176176
public boolean SHOW_ALWAYS = false;
177177
@Comment("{0} - Original server brand (e.g. Paper).")
@@ -181,8 +181,8 @@ public static class BRAND_CHANGER {
181181
@Comment("Doesn't work with srv records.")
182182
public static class HOSTNAMES_MANAGER {
183183

184-
public boolean BLOCK_JOIN = true;
185-
public boolean BLOCK_PING = true;
184+
public boolean BLOCK_JOIN = false;
185+
public boolean BLOCK_PING = false;
186186
@Comment("Connections IP logging.")
187187
public boolean DEBUG = false;
188188
@Comment("For \"debug\" option.")
@@ -191,7 +191,7 @@ public static class HOSTNAMES_MANAGER {
191191
public String KICK_REASON = "&cPlease, don't connect to the direct ip!{NL}Use example.com";
192192
public boolean WHITELIST = true;
193193
@Comment("IP Addresses starting with \"127.\" or equal to \"localhost\" will be blocked.")
194-
public boolean BLOCK_LOCAL_ADDRESSES = true;
194+
public boolean BLOCK_LOCAL_ADDRESSES = false;
195195
@Comment("DoMaIn.net will be similar to domain.net.")
196196
public boolean IGNORE_CASE = true;
197197
public List<String> HOSTNAMES = List.of("your-domain.net", "your-domain.com");

0 commit comments

Comments
 (0)