Skip to content

Commit 0b65ac6

Browse files
feat: Added server workflow
1 parent 93d433b commit 0b65ac6

6 files changed

Lines changed: 367 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Publish workflow
2+
on:
3+
push:
4+
5+
env:
6+
REGISTRY: ghcr.io
7+
8+
permissions:
9+
contents: write
10+
packages: write
11+
12+
jobs:
13+
build:
14+
if: ( github.event_name == 'push' && ( github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') ) )
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
projects:
19+
- path: ./
20+
name: salmon
21+
outputs:
22+
image: ${{ steps.image-ref.outputs.image }}
23+
image_latest: ${{ steps.image-ref.outputs.image_latest }}
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
28+
- name: Set up Docker Buildx
29+
uses: docker/setup-buildx-action@v3
30+
31+
- name: Login to Container registry
32+
uses: docker/login-action@v3
33+
with:
34+
registry: ${{ env.REGISTRY }}
35+
username: ${{ github.actor }}
36+
password: ${{ secrets.GITHUB_TOKEN }}
37+
38+
- name: Create image ref
39+
id: image-ref
40+
run: |
41+
REF=$(git rev-parse --short $GITHUB_SHA)
42+
IMAGE=${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.projects.name }}:${REF}
43+
IMAGE_LATEST=${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.projects.name }}:latest
44+
45+
echo "image=${IMAGE}" >> $GITHUB_STATE
46+
echo "image_latest=${IMAGE_LATEST}" >> $GITHUB_OUTPUT
47+
48+
echo "${IMAGE}" >> $GITHUB_STEP_SUMMARY
49+
50+
- name: Build and push docker image
51+
uses: docker/build-push-action@v6
52+
with:
53+
context: ${{ matrix.projects.path }}
54+
file: ${{ matrix.projects.path }}/Dockerfile
55+
push: true
56+
platforms: linux/amd64,linux/arm64,windows/amd64,windows/arm64,darwin/amd64,darwin/arm64,linux/arm/v7,linux/arm/v8,linux/s390x
57+
cache-from: type=registry,ref=${{ steps.image-ref.outputs.image_latest }}
58+
cache-to: type=inline
59+
tags: |
60+
${{ steps.image-ref.outputs.image }}
61+
${{ steps.image-ref.outputs.image_latest }}

Dockerfile

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM --platform=$BUILDPLATFORM debian AS build
2+
3+
WORKDIR /paper
4+
5+
COPY ./server.properties /paper/server.properties
6+
COPY ./bukkit.yml /paper/bukkit.yml
7+
COPY ./spigot.yml /paper/spigot.yml
8+
9+
COPY install.sh /paper/installer.sh
10+
11+
RUN apt-get update
12+
RUN apt-get install jq curl -y
13+
RUN chmod +x ./installer.sh && ./installer.sh
14+
RUN rm ./installer.sh -rf
15+
16+
17+
FROM --platform=$BUILDPLATFORM ghcr.io/graalvm/graalvm-community AS RUN
18+
19+
WORKDIR /paper
20+
21+
COPY --from=BUILD /paper/ /paper
22+
23+
EXPOSE 25565
24+
25+
CMD ["java", "-Xmx2G", "-Xms2G", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseJVMCICompiler", "-Dcom.mojang.eula.agree=true", "-jar", "paperclip.jar", "--nogui"]

bukkit.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
settings:
2+
allow-end: false
3+
warn-on-overload: true
4+
permissions-file: permissions.yml
5+
update-folder: update
6+
plugin-profiling: false
7+
connection-throttle: 4000
8+
query-plugins: true
9+
deprecated-verbose: default
10+
shutdown-message: Server closed
11+
minimum-api: none
12+
use-map-color-cache: true
13+
spawn-limits:
14+
monsters: -1
15+
animals: -1
16+
water-animals: -1
17+
water-ambient: -1
18+
water-underground-creature: -1
19+
axolotls: -1
20+
ambient: -1
21+
chunk-gc:
22+
period-in-ticks: 1200
23+
ticks-per:
24+
animal-spawns: -1
25+
monster-spawns: -1
26+
water-spawns: -1
27+
water-ambient-spawns: -1
28+
water-underground-creature-spawns: -1
29+
axolotl-spawns: -1
30+
ambient-spawns: -1
31+
autosave: -1
32+
aliases: now-in-commands.yml

install.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env sh
2+
3+
PROJECT="paper"
4+
MINECRAFT_VERSION="1.21.3"
5+
6+
LATEST_BUILD=$(curl -s https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds | \
7+
jq -r '.builds | map(select(.channel == "default") | .build) | .[-1]')
8+
9+
if [ "$LATEST_BUILD" != "null" ]; then
10+
JAR_NAME=${PROJECT}-${MINECRAFT_VERSION}-${LATEST_BUILD}.jar
11+
PAPERMC_URL="https://api.papermc.io/v2/projects/${PROJECT}/versions/${MINECRAFT_VERSION}/builds/${LATEST_BUILD}/downloads/${JAR_NAME}"
12+
13+
curl -o paperclip.jar $PAPERMC_URL
14+
echo "Download completed"
15+
else
16+
echo "No stable build for version $MINECRAFT_VERSION found :("
17+
fi

server.properties

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
accept-transfers=false
2+
allow-flight=true
3+
allow-nether=false
4+
broadcast-console-to-ops=false
5+
broadcast-rcon-to-ops=false
6+
bug-report-link=
7+
debug=false
8+
difficulty=peaceful
9+
enable-command-block=false
10+
enable-jmx-monitoring=false
11+
enable-query=false
12+
enable-rcon=false
13+
enable-status=false
14+
enforce-secure-profile=false
15+
enforce-whitelist=false
16+
entity-broadcast-range-percentage=100
17+
force-gamemode=false
18+
function-permission-level=2
19+
gamemode=survival
20+
generate-structures=false
21+
generator-settings={}
22+
hardcore=false
23+
hide-online-players=false
24+
initial-disabled-packs=
25+
initial-enabled-packs=vanilla
26+
level-name=world
27+
level-seed=
28+
level-type=minecraft:flat
29+
log-ips=false
30+
max-chained-neighbor-updates=1000000
31+
max-players=100
32+
max-tick-time=60000
33+
max-world-size=29999984
34+
motd=A dummy server
35+
network-compression-threshold=-1
36+
online-mode=false
37+
op-permission-level=4
38+
pause-when-empty-seconds=-1
39+
player-idle-timeout=0
40+
prevent-proxy-connections=false
41+
pvp=true
42+
query.port=25565
43+
rate-limit=0
44+
rcon.password=
45+
rcon.port=25575
46+
region-file-compression=deflate
47+
require-resource-pack=false
48+
resource-pack=
49+
resource-pack-id=
50+
resource-pack-prompt=
51+
resource-pack-sha1=
52+
server-ip=
53+
server-port=25565
54+
simulation-distance=10
55+
spawn-animals=false
56+
spawn-monsters=false
57+
spawn-npcs=false
58+
spawn-protection=16
59+
sync-chunk-writes=false
60+
text-filtering-config=
61+
use-native-transport=true
62+
view-distance=10
63+
white-list=false

spigot.yml

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
messages:
2+
whitelist: You are not whitelisted on this server!
3+
unknown-command: Unknown command. Type "/help" for help.
4+
server-full: The server is full!
5+
outdated-client: Outdated client! Please use {0}
6+
outdated-server: Outdated server! I'm still on {0}
7+
restart: Server is restarting
8+
settings:
9+
bungeecord: true
10+
save-user-cache-on-stop-only: true
11+
sample-count: 12
12+
player-shuffle: 0
13+
user-cache-size: 1000
14+
moved-wrongly-threshold: 0.0625
15+
moved-too-quickly-multiplier: 10.0
16+
timeout-time: 60
17+
restart-on-crash: true
18+
restart-script: ./start.sh
19+
netty-threads: 4
20+
attribute:
21+
maxAbsorption:
22+
max: 2048.0
23+
maxHealth:
24+
max: 2048.0
25+
movementSpeed:
26+
max: 2048.0
27+
attackDamage:
28+
max: 2048.0
29+
log-villager-deaths: true
30+
log-named-deaths: true
31+
debug: false
32+
commands:
33+
tab-complete: 0
34+
send-namespaced: true
35+
log: true
36+
spam-exclusions:
37+
- /skill
38+
silent-commandblock-console: false
39+
replace-commands:
40+
- setblock
41+
- summon
42+
- testforblock
43+
- tellraw
44+
advancements:
45+
disable-saving: true
46+
disabled:
47+
- '*'
48+
world-settings:
49+
default:
50+
below-zero-generation-in-existing-chunks: true
51+
view-distance: default
52+
simulation-distance: default
53+
thunder-chance: 100000
54+
merge-radius:
55+
item: 0.5
56+
exp: -1.0
57+
mob-spawn-range: 8
58+
item-despawn-rate: 6000
59+
arrow-despawn-rate: 1200
60+
trident-despawn-rate: 1200
61+
zombie-aggressive-towards-villager: true
62+
nerf-spawner-mobs: false
63+
enable-zombie-pigmen-portal-spawns: true
64+
wither-spawn-sound-radius: 0
65+
end-portal-sound-radius: 0
66+
hanging-tick-frequency: 100
67+
unload-frozen-chunks: false
68+
growth:
69+
cactus-modifier: 100
70+
cane-modifier: 100
71+
melon-modifier: 100
72+
mushroom-modifier: 100
73+
pumpkin-modifier: 100
74+
sapling-modifier: 100
75+
beetroot-modifier: 100
76+
carrot-modifier: 100
77+
potato-modifier: 100
78+
torchflower-modifier: 100
79+
wheat-modifier: 100
80+
netherwart-modifier: 100
81+
vine-modifier: 100
82+
cocoa-modifier: 100
83+
bamboo-modifier: 100
84+
sweetberry-modifier: 100
85+
kelp-modifier: 100
86+
twistingvines-modifier: 100
87+
weepingvines-modifier: 100
88+
cavevines-modifier: 100
89+
glowberry-modifier: 100
90+
pitcherplant-modifier: 100
91+
entity-activation-range:
92+
animals: 32
93+
monsters: 32
94+
raiders: 64
95+
misc: 16
96+
water: 16
97+
villagers: 32
98+
flying-monsters: 32
99+
wake-up-inactive:
100+
animals-max-per-tick: 4
101+
animals-every: 1200
102+
animals-for: 100
103+
monsters-max-per-tick: 8
104+
monsters-every: 400
105+
monsters-for: 100
106+
villagers-max-per-tick: 4
107+
villagers-every: 600
108+
villagers-for: 100
109+
flying-monsters-max-per-tick: 8
110+
flying-monsters-every: 200
111+
flying-monsters-for: 100
112+
villagers-work-immunity-after: 100
113+
villagers-work-immunity-for: 20
114+
villagers-active-for-panic: true
115+
tick-inactive-villagers: true
116+
ignore-spectators: false
117+
entity-tracking-range:
118+
players: 128
119+
animals: 96
120+
monsters: 96
121+
misc: 96
122+
display: 128
123+
other: 64
124+
ticks-per:
125+
hopper-transfer: 8
126+
hopper-check: 1
127+
hopper-amount: 1
128+
hopper-can-load-chunks: false
129+
dragon-death-sound-radius: 0
130+
seed-village: 10387312
131+
seed-desert: 14357617
132+
seed-igloo: 14357618
133+
seed-jungle: 14357619
134+
seed-swamp: 14357620
135+
seed-monument: 10387313
136+
seed-shipwreck: 165745295
137+
seed-ocean: 14357621
138+
seed-outpost: 165745296
139+
seed-endcity: 10387313
140+
seed-slime: 987234911
141+
seed-nether: 30084232
142+
seed-mansion: 10387319
143+
seed-fossil: 14357921
144+
seed-portal: 34222645
145+
seed-ancientcity: 20083232
146+
seed-trailruins: 83469867
147+
seed-trialchambers: 94251327
148+
seed-buriedtreasure: 10387320
149+
seed-mineshaft: default
150+
seed-stronghold: default
151+
hunger:
152+
jump-walk-exhaustion: 0.05
153+
jump-sprint-exhaustion: 0.2
154+
combat-exhaustion: 0.1
155+
regen-exhaustion: 6.0
156+
swim-multiplier: 0.01
157+
sprint-multiplier: 0.1
158+
other-multiplier: 0.0
159+
max-tnt-per-tick: 100
160+
max-tick-time:
161+
tile: 50
162+
entity: 50
163+
verbose: false
164+
players:
165+
disable-saving: true
166+
config-version: 12
167+
stats:
168+
disable-saving: true
169+
forced-stats: {}

0 commit comments

Comments
 (0)