Skip to content

Commit ef8c5cb

Browse files
committed
Add MonoMod and NLua
1 parent 6243bef commit ef8c5cb

4 files changed

Lines changed: 79 additions & 13 deletions

File tree

.github/workflows/build-libs.yml

Lines changed: 71 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ concurrency:
1313

1414
permissions:
1515
contents: write
16+
17+
env:
18+
BUILD_TYPE: Release
19+
NET_FRAMEWORK: net7.0
1620

1721
jobs:
1822
build-fnalibs:
@@ -45,8 +49,6 @@ jobs:
4549
defaults:
4650
run:
4751
shell: sh
48-
env:
49-
BUILD_TYPE: Release
5052

5153
steps:
5254
- uses: actions/checkout@v4
@@ -251,15 +253,15 @@ jobs:
251253
- name: Copy binaries (Linux)
252254
if: ${{ matrix.platform == 'linux' }}
253255
run: |
254-
cp source/FNA/bin/${{ env.BUILD_TYPE }}/net7.0/FNA.dll FNA.dll
255-
cp source/FNA/bin/${{ env.BUILD_TYPE }}/net7.0/FNA.pdb FNA.pdb
256+
cp source/FNA/bin/${{ env.BUILD_TYPE }}/${{ env.NET_FRAMEWORK }}/FNA.dll FNA.dll
257+
cp source/FNA/bin/${{ env.BUILD_TYPE }}/${{ env.NET_FRAMEWORK }}/FNA.pdb FNA.pdb
256258
cp ${{ env.SDL2_DIR }}/lib/libSDL2-2.0.so.0 libSDL2-2.0.so.0
257259
cp source/FNA/lib/FAudio/build/libFAudio.so.0 libFAudio.so.0
258260
cp source/FNA/lib/FNA3D/build/libFNA3D.so.0 libFNA3D.so.0
259261
cp source/FNA/lib/Theorafile/libtheorafile.so libtheorafile.so
260262
261263
- name: Upload Artifacts (Windows)
262-
uses: actions/upload-artifact@v3
264+
uses: actions/upload-artifact@v4
263265
if: ${{ matrix.platform == 'windows' }}
264266
with:
265267
name: fnalibs-windows-${{ matrix.msys2_env }}
@@ -270,7 +272,7 @@ jobs:
270272
libtheorafile.dll
271273
272274
- name: Upload Artifacts (macOS)
273-
uses: actions/upload-artifact@v3
275+
uses: actions/upload-artifact@v4
274276
if: ${{ matrix.platform == 'macos' }}
275277
with:
276278
name: fnalibs-macos-x86_64
@@ -283,7 +285,7 @@ jobs:
283285
libvulkan.1.dylib
284286
285287
- name: Upload Artifacts (Linux)
286-
uses: actions/upload-artifact@v3
288+
uses: actions/upload-artifact@v4
287289
if: ${{ matrix.platform == 'linux' }}
288290
with:
289291
name: fnalibs-linux-x86_64
@@ -294,6 +296,57 @@ jobs:
294296
libFAudio.so.0
295297
libFNA3D.so.0
296298
libtheorafile.so
299+
300+
build-managed-libs:
301+
name: "Build Managed Libs (Any)"
302+
runs-on: ubuntu-latest
303+
defaults:
304+
run:
305+
shell: sh
306+
307+
steps:
308+
- uses: actions/checkout@v4
309+
with:
310+
sparse-checkout: |
311+
source
312+
patches
313+
submodules: recursive
314+
315+
- uses: actions/setup-dotnet@v4
316+
with:
317+
global-json-file: source/MonoMod/global.json
318+
319+
- name: Get SN
320+
run: sudo apt install -y mono-devel
321+
322+
- name: Build MonoMod
323+
working-directory: source/MonoMod
324+
run: |
325+
dotnet publish -c ${{ env.BUILD_TYPE }} -f ${{ env.NET_FRAMEWORK }} src/MonoMod.Utils/MonoMod.Utils.csproj
326+
dotnet publish -c ${{ env.BUILD_TYPE }} -f ${{ env.NET_FRAMEWORK }} src/MonoMod.Patcher/MonoMod.Patcher.csproj
327+
dotnet publish -c ${{ env.BUILD_TYPE }} -f ${{ env.NET_FRAMEWORK }} src/MonoMod.RuntimeDetour/MonoMod.RuntimeDetour.csproj
328+
dotnet publish -c ${{ env.BUILD_TYPE }} -f ${{ env.NET_FRAMEWORK }} src/MonoMod.RuntimeDetour.HookGen/MonoMod.RuntimeDetour.HookGen.csproj
329+
330+
- name: Build NLua
331+
working-directory: source/NLua
332+
run: dotnet publish -c ${{ env.BUILD_TYPE }} build/net6.0/NLua.net6.0.csproj
333+
334+
- name: Copy artifacts
335+
run: |
336+
MM_DIR=$(echo "${{ env.BUILD_TYPE }} ${{ env.NET_FRAMEWORK }}" | awk '{print tolower($1) "_" $2}')
337+
mkdir all_artifacts
338+
cp source/MonoMod/artifacts/publish/MonoMod.Utils/$MM_DIR/* all_artifacts
339+
cp source/MonoMod/artifacts/publish/MonoMod.Patcher/$MM_DIR/* all_artifacts
340+
cp source/MonoMod/artifacts/publish/MonoMod.RuntimeDetour/$MM_DIR/* all_artifacts
341+
cp source/MonoMod/artifacts/publish/MonoMod.RuntimeDetour.HookGen/$MM_DIR/* all_artifacts
342+
343+
cp -r source/NLua/lib/${{ env.BUILD_TYPE }}/net6.0/publish/* all_artifacts
344+
345+
- name: Upload Artifacts
346+
uses: actions/upload-artifact@v4
347+
with:
348+
name: managed-libraries
349+
path: all_artifacts
297350

298351
build-piton:
299352
strategy:
@@ -361,15 +414,15 @@ jobs:
361414
run: mv target/${{ matrix.target }}/release/${{ startsWith(matrix.os, 'windows') && 'piton.exe' || 'piton' }} ${{ matrix.lib_name }}
362415

363416
- name: Upload Piton binaries
364-
uses: actions/upload-artifact@v3
417+
uses: actions/upload-artifact@v4
365418
with:
366-
name: piton-apphosts
419+
name: piton-apphosts-${{ matrix.target }}
367420
path: source/Piton/apphost/${{ matrix.lib_name }}
368421

369422
generate-lib-ext:
370423
name: Generate lib-ext
371424
runs-on: ubuntu-latest
372-
needs: [build-fnalibs, build-piton]
425+
needs: [build-fnalibs, build-managed-libs, build-piton]
373426

374427
steps:
375428
- uses: actions/checkout@v4
@@ -381,7 +434,7 @@ jobs:
381434
rm -rf ../lib-ext ../binaries
382435
mkdir ../lib-ext ../binaries
383436
384-
- uses: actions/download-artifact@v3
437+
- uses: actions/download-artifact@v4
385438
with:
386439
path: ../binaries
387440

@@ -451,6 +504,8 @@ jobs:
451504
### Everest Libraries
452505
mv ../binaries/fnalibs-linux-x86_64/FNA.dll .
453506
mv ../binaries/fnalibs-linux-x86_64/FNA.pdb .
507+
508+
mv ../binaries/managed-libraries/* .
454509
455510
mv ../binaries/fnalibs-windows-i686/* lib64-win-x86
456511
mv ../binaries/fnalibs-windows-x86_64/* lib64-win-x64
@@ -463,7 +518,10 @@ jobs:
463518
cp ../binaries/discord_game_sdk/lib/x86_64/discord_game_sdk.so lib64-linux/libdiscord_game_sdk.so
464519
465520
### Piton
466-
mv ../binaries/piton-apphosts piton
521+
mv ../binaries/piton-apphosts-i686-pc-windows-msvc piton
522+
mv ../binaries/piton-apphosts-x86_64-pc-windows-msvc piton
523+
mv ../binaries/piton-apphosts-x86_64-unknown-linux-gnu piton
524+
mv ../binaries/piton-apphosts-x86_64-apple-darwin piton
467525
468526
popd
469527
@@ -483,7 +541,7 @@ jobs:
483541
cp -r ../lib-ext/* .
484542
485543
git add -f .
486-
git commit -m "Update binaries for ${{ github.sha}}" || true
544+
git commit -m "Update binaries for ${{ github.sha }}" || true
487545
git push origin binaries
488546
489547

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@
1919
[submodule "source/SDL_GameControllerDB"]
2020
path = source/SDL_GameControllerDB
2121
url = https://github.com/mdqinc/SDL_GameControllerDB
22+
[submodule "source/MonoMod"]
23+
path = source/MonoMod
24+
url = https://github.com/MonoMod/MonoMod/
25+
[submodule "source/NLua"]
26+
path = source/NLua
27+
url = https://github.com/EverestAPI/NLua/

source/MonoMod

Submodule MonoMod added at be053cf

source/NLua

Submodule NLua added at 603499e

0 commit comments

Comments
 (0)