-
Notifications
You must be signed in to change notification settings - Fork 17
194 lines (141 loc) · 5.8 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
name: Build C/C++
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
linux:
name: Linux Build
runs-on: ubuntu-latest
container: ubuntu:18.04
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION: node18
ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION: node18
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm test
- name: Add i386 architecture
run: dpkg --add-architecture i386
- name: Update repository
run: apt-get update
- name: Install build dependencies
run: apt-get install -qq -y wget unzip build-essential gcc-4.8-multilib g++-4.8-multilib libgcc1:i386 libcurl4-openssl-dev:i386 zlib1g-dev:i386 libssl-dev:i386
- name: Update alternatives
run: update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 100 --slave /usr/bin/g++ g++ /usr/bin/g++-4.8
- name: Run build
working-directory: ./MatchBot
run: make
- name: Make Match BOT path
run: mkdir -p publish/addons/matchbot/dlls
- name: Move released file to dlls
run: mv ./MatchBot/Release/matchbot_mm.so publish/addons/matchbot/dlls
- name: Copy cstrike contents to publish dir
run: cp -ar cstrike/. publish
- name: Get latest release version of metamod-r
run: wget --quiet https://github.com/rehlds/Metamod-R/releases/download/1.3.0.149/metamod-bin-1.3.0.149.zip
- name: Unzip metamod library to metamod folder
run: unzip -p metamod-bin*.zip addons/metamod/metamod_i386.so > publish/addons/metamod/metamod_i386.so
- name: Get latest release version of hitbox_fixer
run: wget --quiet https://github.com/Garey27/hitbox_fixer/releases/download/2.0.3/hitbox_fix-bin-2.0.3.zip
- name: Unzip hitbox_fixer library to metamod folder
run: unzip -p hitbox_fix-bin*.zip addons/hitboxfixer/hitbox_fix_mm_i386.so > publish/addons/hitboxfixer/hitbox_fix_mm_i386.so
- name: Download Accuracy Fix
run: wget --quiet https://github.com/SmileYzn/AccuracyFix/releases/download/1.1.16/linux32.zip
- name: Unzip accuracy-fix library to metamod folder
run: unzip -p linux32.zip addons/accuracyfix/dlls/accuracyfix_mm.so > publish/addons/accuracyfix/accuracyfix_mm.so
- name: Deploy artifacts
uses: actions/upload-artifact@v3
with:
name: linux32
path: publish/*
windows:
name: Windows Build
runs-on: windows-latest
env:
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release
steps:
- name: Setup Checkout
uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Run Build
working-directory: ${{env.GITHUB_WORKSPACE}}
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}
- name: Move release file to publish
working-directory: ${{env.GITHUB_WORKSPACE}}
run: |
# Make publish directory
mkdir publish\addons\matchbot\dlls
# Move cstrike files to publish
copy ${{env.SOLUTION_FILE_PATH}}\cstrike\* publish -Recurse -Force
# Move released dll to publish
copy ${{env.BUILD_CONFIGURATION}}\*.dll publish\addons\matchbot\dlls -Recurse -Force
- name: Download Metamod-r
run: |
# Set assets data
$assets = "https://github.com/rehlds/Metamod-R/releases/download/1.3.0.149/metamod-bin-1.3.0.149.zip"
# Get ZIP file name
$zipName = "metamod-bin-1.3.0.138.zip"
# Download ZIP file
Invoke-WebRequest -Uri $assets -Out $zipName
# Extract ZIP File
Expand-Archive $zipName
# Get base name from ZIP file
$baseName = (Get-Item $zipName).BaseName
# DLL from path
$fromPath = ".\" + $baseName + "\addons\metamod\metamod.dll"
# DLL dest path
$DestPath = ".\publish\addons\metamod\metamod.dll"
# Copy item
Copy-Item -Path $fromPath -Destination $DestPath
- name: Download Hitbox Fixer
run: |
# Set assets data
$assets = "https://github.com/Garey27/hitbox_fixer/releases/download/2.0.3/hitbox_fix-bin-2.0.3.zip"
# Get ZIP file name
$zipName = "hitbox_fix-bin-1.1.5.zip"
# Download ZIP file
Invoke-WebRequest -Uri $assets -Out $zipName
# Extract ZIP File
Expand-Archive $zipName
# Get base name from ZIP file
$baseName = (Get-Item $zipName).BaseName
# DLL from path
$fromPath = ".\" + $baseName + "\addons\hitboxfixer\hitbox_fix_mm.dll"
# DLL dest path
$DestPath = ".\publish\addons\hitboxfixer\hitbox_fix_mm.dll"
# Copy item
Copy-Item -Path $fromPath -Destination $DestPath
- name: Download Accuracy Fix
run: |
# Set assets data
$assets = "https://github.com/SmileYzn/AccuracyFix/releases/download/1.1.16/win32.zip"
# Get ZIP file name
$zipName = "win32.zip"
# Download ZIP file
Invoke-WebRequest -Uri $assets -Out $zipName
# Extract ZIP File
Expand-Archive $zipName
# Get base name from ZIP file
$baseName = (Get-Item $zipName).BaseName
# DLL from path
$fromPath = ".\" + $baseName + "\addons\accuracyfix\dlls\accuracyfix_mm.dll"
# DLL dest path
$DestPath = ".\publish\addons\accuracyfix\accuracyfix_mm.dll"
# Copy item
Copy-Item -Path $fromPath -Destination $DestPath
- name: Deploy artifacts
uses: actions/upload-artifact@v4
with:
name: win32
path: publish/*