From 30803bbee72b54ddbb720e532623f7c63c3bdcc2 Mon Sep 17 00:00:00 2001
From: Andy Pack <andy@sarsoo.xyz>
Date: Mon, 17 Feb 2025 22:15:08 +0000
Subject: [PATCH] adding dotnet building to ci, wildcard dotnet dll copying

---
 .gitea/workflows/build.yml      | 37 +++++++++++++++++++++++++++++++++
 .github/workflows/build.yml     | 35 +++++++++++++++++++++++++++++++
 FinLib.NET/FinLib/FinLib.csproj |  4 ++--
 3 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml
index b07b7b4..26516b9 100644
--- a/.gitea/workflows/build.yml
+++ b/.gitea/workflows/build.yml
@@ -56,6 +56,43 @@ jobs:
         working-directory: ./pyfinlib
         run: maturin build
 
+  buildNET:
+    name: Build .NET
+    runs-on: ubuntu-latest
+    needs: [ build ] # for ignoring bad builds
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+        with:
+          github-server-url: https://gitea.sheep-ghoul.ts.net
+
+      - name: Install Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+
+      - name: Cargo Build
+        uses: actions-rs/cargo@v1
+        with:
+          command: build
+
+      - name: Setup .NET Core SDK 9.0.x
+        uses: actions/setup-dotnet@v3.0.3
+        with:
+          dotnet-version: 9.0.x
+
+      - name: Install Dependencies
+        working-directory: ./FinLib.NET
+        run: dotnet restore
+
+      - name: Build
+        working-directory: ./FinLib.NET
+        run: dotnet build --configuration Debug --no-restore
+
+      - name: Test
+        working-directory: ./FinLib.NET
+        run: dotnet test --no-restore
+
   buildWASM:
     name: Build WASM
     runs-on: ubuntu-latest
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index da953ff..3709335 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -64,6 +64,41 @@ jobs:
         working-directory: ./pyfinlib
         run: maturin build
 
+  buildNET:
+    name: Build .NET
+    runs-on: ubuntu-latest
+    needs: [ build ] # for ignoring bad builds
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Install Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+
+      - name: Cargo Build
+        uses: actions-rs/cargo@v1
+        with:
+          command: build
+
+      - name: Setup .NET Core SDK 9.0.x
+        uses: actions/setup-dotnet@v3.0.3
+        with:
+          dotnet-version: 9.0.x
+
+      - name: Install Dependencies
+        working-directory: ./FinLib.NET
+        run: dotnet restore
+
+      - name: Build
+        working-directory: ./FinLib.NET
+        run: dotnet build --configuration Debug --no-restore
+
+      - name: Test
+        working-directory: ./FinLib.NET
+        run: dotnet test --no-restore
+
   buildWASM:
     name: Build WASM
     runs-on: ubuntu-latest
diff --git a/FinLib.NET/FinLib/FinLib.csproj b/FinLib.NET/FinLib/FinLib.csproj
index c7e30a4..28d7541 100644
--- a/FinLib.NET/FinLib/FinLib.csproj
+++ b/FinLib.NET/FinLib/FinLib.csproj
@@ -13,13 +13,13 @@
   </PropertyGroup>
 
   <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
-    <Content Include="..\..\target\debug\libfinlib_ffi.dylib">
+    <Content Include="..\..\target\debug\libfinlib_ffi.*">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
   </ItemGroup>
 
   <ItemGroup Condition=" '$(Configuration)' == 'Release' ">
-    <Content Include="..\..\target\release\libfinlib_ffi.dylib">
+    <Content Include="..\..\target\release\libfinlib_ffi.*">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
   </ItemGroup>