-
Notifications
You must be signed in to change notification settings - Fork 123
147 lines (128 loc) · 4.54 KB
/
build.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
name: build
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
linux:
name: Linux
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up needed libs
run: |
sudo apt-get install g++-multilib gcc-multilib
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install nasm:i386
- name: Build server
run: make
- name: Check version difference
if: ${{ !github.head_ref }}
run: |
ver=$(grep '\#define SYS_COMMONVERSION' src/version/version.c | cut -d' ' -f3)
git checkout HEAD~1 src/version/version.c
ver_last=$(grep '\#define SYS_COMMONVERSION' src/version/version.c | cut -d' ' -f3)
if [[ $ver != $ver_last ]]; then
echo "publish_tag=${ver}" >> $GITHUB_ENV
fi
- name: Build plugins
if: ${{ env.publish_tag }}
run: make plugins
- name: Pack plugins
if: ${{ env.publish_tag }}
run: |
cd plugins
mkdir plugins
cp screenshotsender/nehoscreenshotuploader.so plugins/
cp censor/censor.so plugins/
cp cod4x_b3hide/b3hide.so plugins/
cp simplebanlist/simplebanlist.so plugins/
cp pchat/pchat.so plugins/
cp sourcebansplugin/sourcebansplugin.so plugins/
cp warn/warn.so plugins/
cp legacybanlist/legacybanlist.so plugins/
7z a plugins_linux.zip plugins/*
cd ../
- name: Publish release
if: ${{ env.publish_tag }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: ${{ env.publish_tag }}
artifacts: "bin/cod4x18_dedrun,plugins/plugins_linux.zip"
token: ${{ secrets.GITHUB_TOKEN }}
windows:
name: Windows
runs-on: windows-latest
steps:
- name: Get MinGW (i686-8.1.0-release-posix-dwarf)
run: |
cd C:/
Start-BitsTransfer -Source https://downloads.sourceforge.net/mingw-w64/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z -Destination mingw32.7z
7z x -y mingw32.7z
- name: Get NASM
uses: ilammy/setup-nasm@v1
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get pexports
run: |
Invoke-WebRequest "https://github.com/callofduty4x/CoD4x_Server/raw/master/tools/pexports-0.47-mingw32-bin.tar.xz" -OutFile "pexports.tar.xz"
7z x -y pexports.tar.xz
7z x -y pexports.tar
- name: Build
run: |
$path = $env:Path
$env:Path = "C:\mingw32\bin;"
$env:Path += $path
mingw32-make
- name: Check version difference
if: ${{ !github.head_ref }}
run: |
$line = Get-Content src/version/version.c | Select-String -Pattern "#define SYS_COMMONVERSION"
$ver = $line.Line.Split( ' ' )[ 2 ]
git checkout HEAD~1 src/version/version.c
$line = Get-Content src/version/version.c | Select-String -Pattern "#define SYS_COMMONVERSION"
$ver_last = $line.Line.Split( ' ' )[ 2 ]
if( $ver -ne $ver_last )
{
echo "publish_tag=$ver" >> $env:GITHUB_ENV
}
- name: Build plugins
if: ${{ env.publish_tag }}
run: |
$path = $env:Path
$env:Path = "C:\mingw32\bin;"
$env:Path += $path
mingw32-make plugins
- name: Pack plugins
if: ${{ env.publish_tag }}
run: |
cd plugins
mkdir plugins
Copy-Item -Path screenshotsender/nehoscreenshotuploader.dll -Destination plugins/
Copy-Item -Path censor/censor.dll -Destination plugins/
Copy-Item -Path cod4x_b3hide/b3hide.dll -Destination plugins/
Copy-Item -Path simplebanlist/simplebanlist.dll -Destination plugins/
Copy-Item -Path pchat/pchat.dll -Destination plugins/
Copy-Item -Path sourcebansplugin/sourcebansplugin.dll -Destination plugins/
Copy-Item -Path warn/warn.dll -Destination plugins/
Copy-Item -Path legacybanlist/legacybanlist.dll -Destination plugins/
7z a -y plugins_windows.zip plugins/*
cd ../
- name: Publish release
if: ${{ env.publish_tag }}
uses: ncipollo/release-action@v1
with:
allowUpdates: true
tag: ${{ env.publish_tag }}
artifacts: "bin/cod4x18_dedrun.exe,plugins/plugins_windows.zip"
token: ${{ secrets.GITHUB_TOKEN }}