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
917jobs :
1018 versioning :
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
0 commit comments