forked from GTNewHorizons/GT5-Unofficial
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (55 loc) · 1.54 KB
/
fullpack_test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Run Server and Verify
on:
workflow_run:
workflows: ["Build and test"]
types:
- completed
jobs:
run-server:
runs-on: ubuntu-latest
steps:
- name: Download artifacts from Build and test
uses: actions/download-artifact@v4
with:
name: ${{ github.repository_id }}-build-libs
path: build/libs
- name: Download artifacts from the specified run
uses: actions/download-artifact@v4
with:
name: server-new
path: artifacts
- name: Unzip the first level
run: |
mkdir -p extracted1
unzip artifacts/server-new.zip -d extracted1
- name: Unzip the second level
run: |
mkdir -p extracted2
unzip extracted1/server-new.zip -d extracted2
- name: Modify eula.txt
run: |
sed -i 's/eula=false/eula=true/' extracted2/eula.txt
- name: Move JARs to mods folder
run: |
mkdir -p extracted2/mods
cp build/libs/*.jar extracted2/mods/
- name: Run the server
run: |
cd extracted2
chmod +x ./startserver-java9.sh
./startserver-java9.sh &
SERVER_PID=$!
# Wait for 4 minutes to ensure the server runs correctly
sleep 240
# Check if the server is still running
if ps -p $SERVER_PID > /dev/null; then
echo "Server is running successfully."
exit 0
else
echo "Server has crashed or failed."
exit 1
fi
- name: Clean up
if: always()
run: |
kill $SERVER_PID || true