Skip to content

Commit f6deb94

Browse files
committed
update(src): New Files
1 parent 53269be commit f6deb94

File tree

384 files changed

+97484
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

384 files changed

+97484
-0
lines changed

.editorconfig

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Visual Studio generated .editorconfig file with C++ settings.
2+
root = true
3+
4+
[*.{c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
5+
6+
# Visual C++ Code Style settings
7+
8+
cpp_generate_documentation_comments = xml
9+
10+
# Visual C++ Formatting settings
11+
12+
cpp_indent_braces = false
13+
cpp_indent_multi_line_relative_to = innermost_parenthesis
14+
cpp_indent_within_parentheses = indent
15+
cpp_indent_preserve_within_parentheses = true
16+
cpp_indent_case_contents = true
17+
cpp_indent_case_labels = false
18+
cpp_indent_case_contents_when_block = false
19+
cpp_indent_lambda_braces_when_parameter = true
20+
cpp_indent_goto_labels = one_left
21+
cpp_indent_preprocessor = leftmost_column
22+
cpp_indent_access_specifiers = false
23+
cpp_indent_namespace_contents = true
24+
cpp_indent_preserve_comments = false
25+
cpp_new_line_before_open_brace_namespace = ignore
26+
cpp_new_line_before_open_brace_type = ignore
27+
cpp_new_line_before_open_brace_function = ignore
28+
cpp_new_line_before_open_brace_block = ignore
29+
cpp_new_line_before_open_brace_lambda = ignore
30+
cpp_new_line_scope_braces_on_separate_lines = false
31+
cpp_new_line_close_brace_same_line_empty_type = false
32+
cpp_new_line_close_brace_same_line_empty_function = false
33+
cpp_new_line_before_catch = true
34+
cpp_new_line_before_else = true
35+
cpp_new_line_before_while_in_do_while = false
36+
cpp_space_before_function_open_parenthesis = remove
37+
cpp_space_within_parameter_list_parentheses = false
38+
cpp_space_between_empty_parameter_list_parentheses = false
39+
cpp_space_after_keywords_in_control_flow_statements = true
40+
cpp_space_within_control_flow_statement_parentheses = false
41+
cpp_space_before_lambda_open_parenthesis = false
42+
cpp_space_within_cast_parentheses = false
43+
cpp_space_after_cast_close_parenthesis = false
44+
cpp_space_within_expression_parentheses = false
45+
cpp_space_before_block_open_brace = true
46+
cpp_space_between_empty_braces = false
47+
cpp_space_before_initializer_list_open_brace = false
48+
cpp_space_within_initializer_list_braces = true
49+
cpp_space_preserve_in_initializer_list = true
50+
cpp_space_before_open_square_bracket = false
51+
cpp_space_within_square_brackets = false
52+
cpp_space_before_empty_square_brackets = false
53+
cpp_space_between_empty_square_brackets = false
54+
cpp_space_group_square_brackets = true
55+
cpp_space_within_lambda_brackets = false
56+
cpp_space_between_empty_lambda_brackets = false
57+
cpp_space_before_comma = false
58+
cpp_space_after_comma = true
59+
cpp_space_remove_around_member_operators = true
60+
cpp_space_before_inheritance_colon = true
61+
cpp_space_before_constructor_colon = true
62+
cpp_space_remove_before_semicolon = true
63+
cpp_space_after_semicolon = true
64+
cpp_space_remove_around_unary_operator = true
65+
cpp_space_around_binary_operator = insert
66+
cpp_space_around_assignment_operator = insert
67+
cpp_space_pointer_reference_alignment = left
68+
cpp_space_around_ternary_operator = insert
69+
cpp_use_unreal_engine_macro_formatting = true
70+
cpp_wrap_preserve_blocks = one_liners
71+
72+
# Visual C++ Inlcude Cleanup settings
73+
74+
cpp_include_cleanup_add_missing_error_tag_type = suggestion
75+
cpp_include_cleanup_remove_unused_error_tag_type = dimmed

.github/FUNDING.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
custom: https://www.tipeeestream.com/skuzzi/donation
2+
buy_me_a_coffee: swiftlycs2
3+
github: swiftly-solution

.github/workflows/builder.yml

Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
name: "Swiftly Compiler"
2+
3+
on:
4+
push:
5+
branches:
6+
- "**"
7+
pull_request:
8+
9+
jobs:
10+
versioning:
11+
permissions:
12+
contents: write
13+
runs-on: ubuntu-latest
14+
container:
15+
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
16+
outputs:
17+
version: ${{ steps.version.outputs.version }}
18+
steps:
19+
- name: Packages
20+
shell: bash
21+
run: |
22+
sudo apt update
23+
sudo apt install -y curl jq
24+
25+
- name: Generate version
26+
uses: reecetech/[email protected]
27+
id: version
28+
with:
29+
release_branch: master
30+
increment: minor
31+
use_api: true
32+
33+
extensions_build:
34+
name: Extension Build
35+
needs: versioning
36+
runs-on: ${{ matrix.os }}
37+
container: ${{ matrix.container }}
38+
strategy:
39+
fail-fast: false
40+
matrix:
41+
os: [ubuntu-latest, windows-latest]
42+
extension:
43+
[
44+
mysql-extension,
45+
console-filter,
46+
addons-extension,
47+
http-extension,
48+
ip-extension,
49+
utils-extension,
50+
sdktools-extension,
51+
]
52+
include:
53+
- os: ubuntu-latest
54+
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
55+
steps:
56+
- name: Checkout Extension
57+
uses: actions/checkout@v4
58+
with:
59+
repository: swiftly-solution/${{ matrix.extension }}
60+
path: ${{ matrix.extension }}
61+
submodules: recursive
62+
63+
- name: Checkout AMBuild
64+
uses: actions/checkout@v4
65+
with:
66+
repository: alliedmodders/ambuild
67+
path: ambuild
68+
69+
- name: Install AMBuild
70+
run: |
71+
cd ambuild; python setup.py install; cd ..
72+
73+
- name: Version
74+
shell: bash
75+
run: echo "VERSION=${{needs.versioning.outputs.version}}" >> $GITHUB_ENV
76+
77+
- name: Build - Linux
78+
if: matrix.os == 'ubuntu-latest'
79+
working-directory: ${{ matrix.extension }}
80+
shell: bash
81+
run: |
82+
sudo apt update
83+
sudo apt install -y libreadline-dev libboost-all-dev
84+
bash ./setup.sh
85+
86+
- name: Build - Windows
87+
if: matrix.os == 'windows-latest'
88+
working-directory: ${{ matrix.extension }}
89+
run: |
90+
./setup.ps1
91+
92+
- name: IP EXT - Linux
93+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.extension == 'ip-extension' }}
94+
working-directory: ${{ matrix.extension }}
95+
shell: bash
96+
run: |
97+
wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb -O build/package/addons/swiftly/data/GeoLite2-City.mmdb
98+
wget https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb -O build/package/addons/swiftly/data/GeoLite2-ASN.mmdb
99+
100+
- name: IP EXT - Windows
101+
if: ${{ matrix.os == 'windows-latest' && matrix.extension == 'ip-extension' }}
102+
working-directory: ${{ matrix.extension }}
103+
run: |
104+
Set-Location build/package/addons/swiftly
105+
106+
Invoke-WebRequest https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-City.mmdb -OutFile data/GeoLite2-City.mmdb
107+
Invoke-WebRequest https://github.com/P3TERX/GeoLite.mmdb/raw/download/GeoLite2-ASN.mmdb -OutFile data/GeoLite2-ASN.mmdb
108+
109+
Set-Location ../../../..
110+
111+
- name: Upload Artifacts Linux
112+
if: matrix.os == 'ubuntu-latest'
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: ${{matrix.extension}}.Extension.Linux
116+
path: ${{ github.workspace }}/${{ matrix.extension }}/build/package
117+
118+
- name: Upload Artifacts Windows
119+
if: matrix.os == 'windows-latest'
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: ${{matrix.extension}}.Extension.Windows
123+
path: ${{ github.workspace }}/${{ matrix.extension }}/build/package
124+
125+
build:
126+
name: Build
127+
needs: versioning
128+
runs-on: ${{ matrix.os }}
129+
env:
130+
MMSOURCE20: ${{ github.workspace }}/swiftly/alliedmodders/metamod
131+
HL2SDKCS2: ${{ github.workspace }}/swiftly/alliedmodders/hl2sdk
132+
container: ${{ matrix.container }}
133+
strategy:
134+
fail-fast: false
135+
matrix:
136+
os: [ubuntu-latest, windows-latest]
137+
include:
138+
- os: ubuntu-latest
139+
container: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
140+
steps:
141+
- name: Checkout
142+
uses: actions/checkout@v4
143+
with:
144+
path: swiftly
145+
submodules: recursive
146+
147+
- name: Checkout AMBuild
148+
uses: actions/checkout@v4
149+
with:
150+
repository: alliedmodders/ambuild
151+
path: ambuild
152+
153+
- name: Install AMBuild
154+
run: |
155+
cd ambuild; python setup.py install; cd ..
156+
157+
- name: Setup Version
158+
shell: bash
159+
run: echo "SWIFTLY_VERSION=${{needs.versioning.outputs.version}}" >> $GITHUB_ENV
160+
161+
- name: Build - Linux
162+
if: matrix.os == 'ubuntu-latest'
163+
working-directory: swiftly
164+
shell: bash
165+
run: |
166+
sudo apt update
167+
sudo apt install -y libreadline-dev libboost-all-dev unzip
168+
bash ./setup.sh
169+
170+
echo "[Builder] Setting up default plugins"
171+
cp -r build/package build/package2
172+
cd build/package/addons/swiftly
173+
wget https://github.com/swiftly-solution/admins/releases/latest/download/Swiftly.Plugin.Admins.zip
174+
unzip Swiftly.Plugin.Admins.zip
175+
wget https://github.com/swiftly-solution/admins_basecomms/releases/latest/download/Swiftly.Plugin.Admins.BaseComms.zip
176+
unzip Swiftly.Plugin.Admins.BaseComms.zip
177+
wget https://github.com/swiftly-solution/admins_basebans/releases/latest/download/Swiftly.Plugin.Admins.BaseBans.zip
178+
unzip Swiftly.Plugin.Admins.BaseBans.zip
179+
wget https://github.com/swiftly-solution/admins_commands/releases/latest/download/Swiftly.Plugin.Admins.BaseCommands.zip
180+
unzip Swiftly.Plugin.Admins.BaseCommands.zip
181+
wget https://github.com/swiftly-solution/map-chooser/releases/latest/download/Swiftly.Plugin.Map-Chooser.zip
182+
unzip Swiftly.Plugin.Map-Chooser.zip
183+
wget https://github.com/swiftly-solution/cookies/releases/latest/download/cookies.zip
184+
unzip cookies.zip
185+
186+
rm -rf Swiftly.Plugin.Admins.zip
187+
rm -rf Swiftly.Plugin.Admins.BaseComms.zip
188+
rm -rf Swiftly.Plugin.Admins.BaseBans.zip
189+
rm -rf Swiftly.Plugin.Admins.BaseCommands.zip
190+
rm -rf Swiftly.Plugin.Map-Chooser.zip
191+
rm -rf cookies.zip
192+
193+
cd ../../../..
194+
echo "[Builder] Finished setting up default plugins"
195+
196+
- name: Build - Windows
197+
if: matrix.os == 'windows-latest'
198+
working-directory: swiftly
199+
run: |
200+
./setup.ps1
201+
202+
Set-Location build/package/addons/swiftly
203+
204+
Invoke-WebRequest https://github.com/swiftly-solution/admins/releases/latest/download/Swiftly.Plugin.Admins.zip -OutFile Swiftly.Plugin.Admins.zip
205+
Expand-Archive Swiftly.Plugin.Admins.zip -DestinationPath .
206+
Invoke-WebRequest https://github.com/swiftly-solution/admins_basecomms/releases/latest/download/Swiftly.Plugin.Admins.BaseComms.zip -OutFile Swiftly.Plugin.Admins.BaseComms.zip
207+
Expand-Archive Swiftly.Plugin.Admins.BaseComms.zip -DestinationPath .
208+
Invoke-WebRequest https://github.com/swiftly-solution/admins_basebans/releases/latest/download/Swiftly.Plugin.Admins.BaseBans.zip -OutFile Swiftly.Plugin.Admins.BaseBans.zip
209+
Expand-Archive Swiftly.Plugin.Admins.BaseBans.zip -DestinationPath .
210+
Invoke-WebRequest https://github.com/swiftly-solution/admins_commands/releases/latest/download/Swiftly.Plugin.Admins.BaseCommands.zip -OutFile Swiftly.Plugin.Admins.BaseCommands.zip
211+
Expand-Archive Swiftly.Plugin.Admins.BaseCommands.zip -DestinationPath .
212+
Invoke-WebRequest https://github.com/swiftly-solution/map-chooser/releases/latest/download/Swiftly.Plugin.Map-Chooser.zip -OutFile Swiftly.Plugin.Map-Chooser.zip
213+
Expand-Archive Swiftly.Plugin.Map-Chooser.zip -DestinationPath .
214+
Invoke-WebRequest https://github.com/swiftly-solution/cookies/releases/latest/download/cookies.zip -OutFile cookies.zip
215+
Expand-Archive cookies.zip -DestinationPath .
216+
217+
Remove-Item -Force Swiftly.Plugin.Admins.zip
218+
Remove-Item -Force Swiftly.Plugin.Admins.BaseComms.zip
219+
Remove-Item -Force Swiftly.Plugin.Admins.BaseBans.zip
220+
Remove-Item -Force Swiftly.Plugin.Admins.BaseCommands.zip
221+
Remove-Item -Force Swiftly.Plugin.Map-Chooser.zip
222+
Remove-Item -Force cookies.zip
223+
224+
Set-Location ../../../..
225+
226+
- name: Upload Artifacts Linux
227+
if: matrix.os == 'ubuntu-latest'
228+
uses: actions/upload-artifact@v4
229+
with:
230+
name: Swiftly.Plugin.Linux
231+
path: ${{ github.workspace }}/swiftly/build/package
232+
233+
- name: Upload Artifacts Windows
234+
if: matrix.os == 'windows-latest'
235+
uses: actions/upload-artifact@v4
236+
with:
237+
name: Swiftly.Plugin.Windows
238+
path: ${{ github.workspace }}/swiftly/build/package
239+
240+
release:
241+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
242+
permissions:
243+
contents: write
244+
needs: ["versioning", "build", "extensions_build"]
245+
runs-on: ubuntu-latest
246+
container:
247+
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
248+
steps:
249+
- uses: actions/download-artifact@v4
250+
id: download-artifacts
251+
with:
252+
path: build
253+
254+
- name: Prepare ZIP Files
255+
run: |
256+
sudo apt install p7zip-full -y;
257+
258+
find build -type d -name "*Extension.Linux" -exec cp -r {}/addons build/Swiftly.Plugin.Linux \;
259+
find build -type d -name "*Extension.Windows" -exec cp -r {}/addons build/Swiftly.Plugin.Windows \;
260+
261+
(cd build/Swiftly.Plugin.Linux; 7z a -tzip ../../../Swiftly.Plugin.Linux.zip *)
262+
(cd build/Swiftly.Plugin.Windows; 7z a -tzip ../../../Swiftly.Plugin.Windows.zip *)
263+
echo "PATH_ARTIFACTS=$(cd ..; pwd)" >> $GITHUB_ENV
264+
265+
- name: Release
266+
id: release
267+
uses: softprops/action-gh-release@v2
268+
with:
269+
tag_name: v${{ needs.versioning.outputs.version }}
270+
make_latest: "true"
271+
files: |
272+
${{env.PATH_ARTIFACTS}}/Swiftly.Plugin.Linux.zip
273+
${{env.PATH_ARTIFACTS}}/Swiftly.Plugin.Windows.zip

.github/workflows/cleanup.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Clean Artifacts
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
clean:
10+
permissions:
11+
actions: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Cleanup
15+
uses: c-hive/gha-remove-artifacts@v1
16+
with:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
age: "1 minute"
19+
skip-recent: 20

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build/
2+
prototemp/
3+
.xmake/
4+
custom_builder.sh
5+
swiftly.so

0 commit comments

Comments
 (0)