-
-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (101 loc) · 3.95 KB
/
release.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: LLHL - New version release
on:
push:
jobs:
build:
runs-on: ubuntu-latest
container: centos:centos7
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
steps:
- name: Setting up mirrorlist
run: |
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
- name: Install Node.js (v16)
run: |
curl -sL https://rpm.nodesource.com/setup_16.x | bash -
yum install -y nodejs
- name: Checkout LLHL AGMOD repository
uses: actions/checkout@v2
with:
repository: 7mochi/llhl-agmod
path: llhl-agmod
fetch-depth: 0
persist-credentials: false
- name: Build LLHL AGMOD serverfile .so
run: |
yum install -y make git gcc gcc-c++ glibc-devel.i686 libstdc++-devel.i686
mkdir ag-llhl-linux && cd llhl-agmod
CPATH=$CPATH:/usr/include/c++/4.8.5/i686-redhat-linux CFG=$CONFIGURATION make -C dlls
cd $GITHUB_WORKSPACE
cp -i llhl-agmod/dlls/ag_i386.so ag-llhl-linux/ag.so
cp -i llhl-agmod/network/delta.lst ag-llhl-linux
- name: Checkout repository
uses: actions/checkout@v3
- name: Install NodeJS
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies for Linux
run: |
make init-linux
- name: Build LLHL proyect (Linux) with node-amxxpack
run: |
make build-linux
- name: Rename dist folder
run: |
mv dist dist-linux
- name: Install dependencies for Windows
run: |
make init-windows
- name: Build LLHL proyect (Windows) with node-amxxpack
run: |
make build-windows
- name: Generate hashfile.sha1
run: |
# First linux
cd dist-linux
# Find all files in the dist folder except for a few
find "$PWD" -type f -not -name "llhl.cfg" \
-and -not -name "plugins.ini" \
-and -not -name "*.inc" \
-and -not -name "*.sma" \
-and -not -name "*.gam" \
-and -not -name "motd_llhl*" \
-and -not -name "startup_server.cfg" \
-and -not -name "*.sha1" \
-exec sha1sum {} \; > hashfile.sha1
# Go back to root folder
cd $GITHUB_WORKSPACE
# Move hashfile out of dist folder
mv dist-linux/hashfile.sha1 hashfile.sha1
# Now windows
cd dist
# Find remaining files
find "$PWD" -type f -name "*.dll" -exec sha1sum {} \; > hashfile_2.sha1
# Go back again
cd $GITHUB_WORKSPACE
# Move hashfile 2 out of dist folder
mv dist/hashfile_2.sha1 hashfile_2.sha1
# Merge the contents of both files
cat hashfile_2.sha1 >> hashfile.sha1 && rm hashfile_2.sha1
# Remove useless path from the hashfile
sed -e "s,${PWD}/dist-linux/ag/,,g; s,${PWD}/dist/ag/,,g; s,addons/amxmodx/plugins/,,g" -i hashfile.sha1
- name: Replace llhl.amxx on windows with the one from linux
run: |
yes | cp -rf dist-linux/ag/addons/amxmodx/plugins/llhl.amxx dist/ag/addons/amxmodx/plugins/llhl.amxx
- name: Download latest AMX Mod X 1.9
run: |
wget "https://www.amxmodx.org/latest.php?version=1.9&os=linux&package=base" -O amxx-linux.tar.gz
wget "https://www.amxmodx.org/latest.php?version=1.9&os=windows&package=base" -O amxx-windows.zip
tar -xzf amxx-linux.tar.gz -C dist-linux/ag
unzip amxx-windows.zip -d dist/ag
- name: Create folder and move LLHL AGMOD .so
run: |
mkdir dist-linux/ag/dlls
mv llhl-agmod/ag-llhl-linux/ag.so dist-linux/ag/ag.so
- name: Prepare releases in zip
run: |
cd dist-linux && zip -r ../llhl-${{github.ref_name}}-linux.zip * && cd $GITHUB_WORKSPACE
cd dist && zip -r ../llhl-${{github.ref_name}}-windows.zip * && cd $GITHUB_WORKSPACE