Skip to content

Commit 692288a

Browse files
authored
update(core): 'small changes' for v2.0.0 (#106)
Here we go, let's see what will happen
2 parents 2a258be + 17125ea commit 692288a

File tree

8,765 files changed

+199502
-4790
lines changed

Some content is hidden

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

8,765 files changed

+199502
-4790
lines changed

.github/workflows/builder.yml

Lines changed: 189 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@ on:
44
push:
55
branches:
66
- "**"
7+
paths:
8+
- 'src/**'
9+
- 'plugin_files/**'
10+
- 'protobufs/**'
11+
- 'alliedmodders/**'
12+
- 'vendor/**'
13+
- '.github/workflows/**'
714
pull_request:
15+
workflow_dispatch:
816

917
jobs:
1018
versioning:
@@ -27,7 +35,7 @@ jobs:
2735
id: version
2836
with:
2937
release_branch: master
30-
increment: patch
38+
increment: major
3139
use_api: true
3240

3341
extensions_build:
@@ -61,15 +69,10 @@ jobs:
6169
path: ${{ matrix.extension }}
6270
submodules: recursive
6371

64-
- name: Checkout AMBuild
65-
uses: actions/checkout@v4
72+
- name: Setup XMake
73+
uses: xmake-io/github-action-setup-xmake@v1
6674
with:
67-
repository: alliedmodders/ambuild
68-
path: ambuild
69-
70-
- name: Install AMBuild
71-
run: |
72-
cd ambuild; python setup.py install; cd ..
75+
xmake-version: latest
7376

7477
- name: Version
7578
shell: bash
@@ -123,6 +126,102 @@ jobs:
123126
name: ${{matrix.extension}}.Extension.Windows
124127
path: ${{ github.workspace }}/${{ matrix.extension }}/build/package
125128

129+
build_managed:
130+
name: Build Managed C#
131+
needs: versioning
132+
runs-on: ubuntu-latest
133+
steps:
134+
- name: Checkout
135+
uses: actions/checkout@v4
136+
with:
137+
path: swiftly
138+
139+
- name: Setup .NET
140+
uses: actions/setup-dotnet@v4
141+
with:
142+
dotnet-version: "8.0.x"
143+
144+
- name: Clone Extensions
145+
working-directory: swiftly
146+
shell: bash
147+
run: |
148+
extensions=("mysql-extension" "console-filter" "addons-extension" "http-extension" "ip-extension" "utils-extension" "sdktools-extension" "websocket-extension")
149+
150+
for repo in "${extensions[@]}"; do
151+
git clone https://github.com/swiftly-solution/$repo.git
152+
if [ -d $repo/managed ]; then
153+
mkdir -p src/managed/API/Extensions/$repo
154+
cp -rf $repo/managed/* src/managed/API/Extensions/$repo/
155+
fi
156+
done
157+
158+
- uses: actions/upload-artifact@v4
159+
with:
160+
name: swiftlys2-managed-files-${{ needs.versioning.outputs.version }}
161+
path: ${{ github.workspace }}/swiftly/src/managed
162+
163+
- name: Restore CSProj
164+
working-directory: swiftly
165+
shell: bash
166+
run: dotnet restore src/managed/SwiftlyS2.csproj
167+
168+
- name: Build Project
169+
working-directory: swiftly
170+
shell: bash
171+
run: |
172+
dotnet publish -c Release /p:Version=${{needs.versioning.outputs.version}} src/managed
173+
174+
dotnet pack -c Release /p:Version=${{needs.versioning.outputs.version}} src/managed
175+
176+
- uses: actions/upload-artifact@v4
177+
with:
178+
name: swiftlys2-managed-${{ needs.versioning.outputs.version }}
179+
path: ${{ github.workspace }}/swiftly/src/managed/bin/Release
180+
181+
build_docs:
182+
name: Build Documentation
183+
needs: versioning
184+
runs-on: ubuntu-latest
185+
steps:
186+
- name: Checkout
187+
uses: actions/checkout@v4
188+
with:
189+
path: swiftly
190+
191+
- uses: actions/setup-node@v4
192+
with:
193+
node-version: 20
194+
195+
- name: Clone Extensions
196+
working-directory: swiftly
197+
shell: bash
198+
run: |
199+
extensions=("mysql-extension" "console-filter" "addons-extension" "http-extension" "ip-extension" "utils-extension" "sdktools-extension" "websocket-extension")
200+
201+
for repo in "${extensions[@]}"; do
202+
git clone https://github.com/swiftly-solution/$repo.git
203+
if [ -d $repo/documentation ]; then
204+
cp -rf $repo/documentation/* generators/documentation
205+
fi
206+
if [ -d $repo/sdkdocumentation ]; then
207+
cp -rf $repo/sdkdocumentation/* generators/sdkdocumentation
208+
fi
209+
done
210+
211+
- name: Build Documentation
212+
working-directory: swiftly
213+
shell: bash
214+
run: |
215+
cd generators/docsgen
216+
node index.mjs
217+
218+
219+
- name: Upload Pages
220+
uses: actions/upload-artifact@v4
221+
with:
222+
name: swiftlys2-documentation
223+
path: ${{ github.workspace }}/swiftly/generators/docsgen/*.json
224+
126225
build:
127226
name: Build
128227
needs: versioning
@@ -145,15 +244,10 @@ jobs:
145244
path: swiftly
146245
submodules: recursive
147246

148-
- name: Checkout AMBuild
149-
uses: actions/checkout@v4
247+
- name: Setup XMake
248+
uses: xmake-io/github-action-setup-xmake@v1
150249
with:
151-
repository: alliedmodders/ambuild
152-
path: ambuild
153-
154-
- name: Install AMBuild
155-
run: |
156-
cd ambuild; python setup.py install; cd ..
250+
xmake-version: latest
157251

158252
- name: Setup Version
159253
shell: bash
@@ -228,40 +322,104 @@ jobs:
228322
if: matrix.os == 'ubuntu-latest'
229323
uses: actions/upload-artifact@v4
230324
with:
231-
name: Swiftly.Plugin.Linux
325+
name: Swiftly.Core.Linux
232326
path: ${{ github.workspace }}/swiftly/build/package
233327

234328
- name: Upload Artifacts Windows
235329
if: matrix.os == 'windows-latest'
236330
uses: actions/upload-artifact@v4
237331
with:
238-
name: Swiftly.Plugin.Windows
332+
name: Swiftly.Core.Windows
239333
path: ${{ github.workspace }}/swiftly/build/package
240334

335+
packer:
336+
needs: ["build", "extensions_build", "build_managed", "build_docs"]
337+
runs-on: ubuntu-latest
338+
container:
339+
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
340+
steps:
341+
- uses: actions/download-artifact@v4
342+
id: download-artifacts
343+
with:
344+
path: build
345+
346+
- name: Prepare ZIP Files
347+
run: |
348+
sudo apt install unzip -y;
349+
350+
find build -type d -name "*Extension.Linux" -exec cp -r {}/addons build/Swiftly.Core.Linux \;
351+
find build -type d -name "*Extension.Windows" -exec cp -r {}/addons build/Swiftly.Core.Windows \;
352+
353+
find build -type d -name "swiftlys2-managed-*" -exec sh -c 'cp "$1"/net8.0/publish/* build/Swiftly.Core.Linux/addons/swiftly/bin/managed' _ {} \;
354+
find build -type d -name "swiftlys2-managed-*" -exec sh -c 'cp "$1"/net8.0/publish/* build/Swiftly.Core.Windows/addons/swiftly/bin/managed' _ {} \;
355+
356+
mkdir -p build/Swiftly.Core.Linux/addons/swiftly/bin/managed/dotnet
357+
cd build/Swiftly.Core.Linux/addons/swiftly/bin/managed/dotnet
358+
359+
wget https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.19/aspnetcore-runtime-8.0.19-linux-x64.tar.gz
360+
tar zxvf aspnetcore-runtime-8.0.19-linux-x64.tar.gz
361+
rm aspnetcore-runtime-8.0.19-linux-x64.tar.gz
362+
363+
cd ../../../../../../..
364+
365+
mkdir -p build/Swiftly.Core.Windows/addons/swiftly/bin/managed/dotnet
366+
cd build/Swiftly.Core.Windows/addons/swiftly/bin/managed/dotnet
367+
368+
wget https://builds.dotnet.microsoft.com/dotnet/aspnetcore/Runtime/8.0.19/aspnetcore-runtime-8.0.19-win-x64.zip
369+
unzip aspnetcore-runtime-8.0.19-win-x64.zip
370+
rm aspnetcore-runtime-8.0.19-win-x64.zip
371+
372+
cd ../../../../../../..
373+
374+
echo "PATH_ARTIFACTS=$(pwd)" >> $GITHUB_ENV
375+
376+
- name: Upload Artifacts Linux
377+
uses: actions/upload-artifact@v4
378+
with:
379+
name: Swiftly.Plugin.Linux
380+
path: ${{env.PATH_ARTIFACTS}}/build/Swiftly.Core.Linux
381+
382+
- name: Upload Artifacts Windows
383+
uses: actions/upload-artifact@v4
384+
with:
385+
name: Swiftly.Plugin.Windows
386+
path: ${{env.PATH_ARTIFACTS}}/build/Swiftly.Core.Windows
387+
241388
release:
242-
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
389+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.event.head_commit.verification.verified == true }}
243390
permissions:
244391
contents: write
245-
needs: ["versioning", "build", "extensions_build"]
392+
needs: ["packer", "versioning"]
246393
runs-on: ubuntu-latest
247394
container:
248395
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk
249396
steps:
250397
- uses: actions/download-artifact@v4
251398
id: download-artifacts
252399
with:
400+
name: Swiftly.Plugin.Linux
253401
path: build
254402

255-
- name: Prepare ZIP Files
256-
run: |
257-
sudo apt install p7zip-full -y;
403+
- uses: actions/download-artifact@v4
404+
id: download-artifacts-2
405+
with:
406+
name: Swiftly.Plugin.Windows
407+
path: build
408+
409+
- uses: actions/download-artifact@v4
410+
id: download-managed
411+
with:
412+
name: swiftlys2-managed-${{ needs.versioning.outputs.version }}
413+
path: build
258414

259-
find build -type d -name "*Extension.Linux" -exec cp -r {}/addons build/Swiftly.Plugin.Linux \;
260-
find build -type d -name "*Extension.Windows" -exec cp -r {}/addons build/Swiftly.Plugin.Windows \;
415+
- name: Setup .NET
416+
uses: actions/setup-dotnet@v4
417+
with:
418+
dotnet-version: "8.0.x"
261419

262-
(cd build/Swiftly.Plugin.Linux; 7z a -tzip ../../../Swiftly.Plugin.Linux.zip *)
263-
(cd build/Swiftly.Plugin.Windows; 7z a -tzip ../../../Swiftly.Plugin.Windows.zip *)
264-
echo "PATH_ARTIFACTS=$(cd ..; pwd)" >> $GITHUB_ENV
420+
- name: Prepare ZIP Files
421+
run: |
422+
dotnet nuget push build/swiftlys2-managed-${{ needs.versioning.outputs.version }}/SwiftlyS2.${{ needs.versioning.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
265423
266424
- name: Release
267425
id: release
@@ -271,5 +429,5 @@ jobs:
271429
make_latest: "true"
272430
body: "Changelog for this version can be found inside [CHANGELOG.md](https://github.com/swiftly-solution/swiftly/blob/master/CHANGELOG.md)"
273431
files: |
274-
${{env.PATH_ARTIFACTS}}/Swiftly.Plugin.Linux.zip
275-
${{env.PATH_ARTIFACTS}}/Swiftly.Plugin.Windows.zip
432+
build/Swiftly.Plugin.Linux.zip
433+
build/Swiftly.Plugin.Windows.zip

.github/workflows/cleanup.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ jobs:
1515
uses: c-hive/gha-remove-artifacts@v1
1616
with:
1717
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
age: "1 minute"
18+
age: "2 days"
1919
skip-recent: 20

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
build/
2-
prototemp/
32
.xmake/
43
custom_builder.sh
5-
swiftly.so
4+
swiftly.so
5+
src/managed/bin/
6+
src/managed/obj/
7+
generators/documentation/temp/
8+
.vs/

.vscode/c_cpp_properties.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
{
44
"name": "Win32",
55
"includePath": [
6-
"${workspaceFolder}/build/swiftly/windows-x86_64/**",
7-
"${workspaceFolder}/build/swiftly/linux-x86_64/**",
6+
"${workspaceFolder}/build/proto/**",
87
"${workspaceFolder}/alliedmodders/hl2sdk-cs2/**",
98
"${workspaceFolder}/alliedmodders/metamod/**",
109
"${workspaceFolder}/alliedmodders/metamod/core/**",
@@ -14,19 +13,20 @@
1413
"${workspaceFolder}/vendor/dynohook/win64/include/**",
1514
"${workspaceFolder}/vendor/dyncall/win64/include/**",
1615
"${workspaceFolder}/vendor/embedder/libs/lua/**",
17-
"${workspaceFolder}/vendor/embedder/libs/js/**"
16+
"${workspaceFolder}/vendor/embedder/libs/js/**",
17+
"${workspaceFolder}/vendor/embedder/libs/dotnet/**"
1818
],
1919
"defines": [
2020
"META_IS_SOURCE2"
2121
],
2222
"cStandard": "c17",
2323
"cppStandard": "c++17",
24-
"compilerPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\Hostx64\\x64\\cl.exe"
24+
"intelliSenseMode": "linux-gcc-x64"
2525
},
2626
{
2727
"name": "Linux",
2828
"includePath": [
29-
"${workspaceFolder}/build/swiftly/linux-x86_64/**",
29+
"${workspaceFolder}/build/proto/**",
3030
"${workspaceFolder}/alliedmodders/hl2sdk/**",
3131
"${workspaceFolder}/alliedmodders/metamod/**",
3232
"${workspaceFolder}/alliedmodders/metamod/core/**",
@@ -36,7 +36,8 @@
3636
"${workspaceFolder}/vendor/dynohook/linuxsteamrt64/include/**",
3737
"${workspaceFolder}/vendor/dyncall/linuxsteamrt64/include/**",
3838
"${workspaceFolder}/vendor/embedder/libs/lua/**",
39-
"${workspaceFolder}/vendor/embedder/libs/js/**"
39+
"${workspaceFolder}/vendor/embedder/libs/js/**",
40+
"${workspaceFolder}/vendor/embedder/libs/dotnet/**"
4041
],
4142
"defines": [
4243
"META_IS_SOURCE2"

.vscode/settings.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
"*.tcc": "cpp",
9696
"future": "cpp",
9797
"variant": "cpp",
98-
"csetjmp": "cpp"
99-
}
98+
"csetjmp": "cpp",
99+
"typeindex": "cpp"
100+
},
101+
"cmake.sourceDirectory": "/root/swiftly/vendor/asmjit"
100102
}

.vscode/tasks.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Build & Update Managed",
6+
"type": "shell",
7+
"command": "dotnet restore src/managed/SwiftlyS2.csproj && dotnet publish -c Release src/managed && cp -r src/managed/bin/Release/net8.0/publish/* /var/lib/pterodactyl/volumes/b43e4390-681c-49a7-9230-2a418a4eb022/game/csgo/addons/swiftly/bin/managed",
8+
"group": {
9+
"kind": "build",
10+
"isDefault": false
11+
}
12+
},
13+
{
14+
"label": "Build & Update Core",
15+
"type": "shell",
16+
"command": "bash custom_builder.sh",
17+
"group": {
18+
"kind": "build",
19+
"isDefault": false
20+
}
21+
}
22+
]
23+
}

0 commit comments

Comments
 (0)