From 11ea1c1e828f094d21618983b9b8002ec33f81ce Mon Sep 17 00:00:00 2001
From: Andy Pack <andy@sarsoo.xyz>
Date: Mon, 17 Feb 2025 23:38:19 +0000
Subject: [PATCH] tweaking nuget and pypi publishing

---
 .gitea/workflows/build.yml      | 25 +++++++++++++++----------
 Cargo.lock                      |  8 ++++----
 Cargo.toml                      |  2 +-
 FinLib.NET/FinLib/FinLib.csproj |  2 +-
 4 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml
index 706006c..ec462bd 100644
--- a/.gitea/workflows/build.yml
+++ b/.gitea/workflows/build.yml
@@ -94,7 +94,7 @@ jobs:
         run: dotnet test --no-restore
 
   publishNET:
-    name: Build .NET
+    name: Publish .NET
     runs-on: ubuntu-latest
     needs: [ buildNET ] # for ignoring bad builds
     steps:
@@ -118,9 +118,6 @@ jobs:
         with:
           dotnet-version: 9.0.x
 
-      - name: Add Gitea Repo
-        run: dotnet nuget add source --name gitea --api-key ${{ secrets.DOCKERHUB_TOKEN }} https://gitea.sheep-ghoul.ts.net/api/packages/sarsoo/nuget/index.json
-
       - name: Install Dependencies
         working-directory: ./FinLib.NET
         run: dotnet restore
@@ -131,7 +128,7 @@ jobs:
 
       - name: Push
         working-directory: ./FinLib.NET/FinLib
-        run: dotnet nuget push --source gitea ./bin/Release/FinLib.NET.0.0.4.nupkg
+        run: dotnet nuget push ./bin/Release/FinLib.NET.0.0.5.nupkg --api-key ${{ secrets.DOCKERHUB_TOKEN }} --source https://gitea.sheep-ghoul.ts.net/api/packages/sarsoo/nuget/index.json
 
   buildWASM:
     name: Build WASM
@@ -247,13 +244,21 @@ jobs:
         with:
           github-server-url: https://gitea.sheep-ghoul.ts.net
 
+      - name: Install Rust
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+
       - name: Install Python 3
         uses: actions/setup-python@v4
         with:
           python-version: ${{ env.python-version }}
 
-      - uses: PyO3/maturin-action@v1
-        with:
-          command: publish
-          args: --repository-url https://gitea.sheep-ghoul.ts.net/api/packages/sarsoo/pypi/simple -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
-          working-directory: ./pyfinlib
\ No newline at end of file
+      - name: Install Maturin
+        run: sudo apt update && sudo apt install -y python3-maturin
+
+      - name: Publish
+        working-directory: ./pyfinlib
+        run: maturin publish --repository-url https://gitea.sheep-ghoul.ts.net/api/packages/sarsoo/pypi/simple
+        env:
+          MATURIN_PYPI_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
\ No newline at end of file
diff --git a/Cargo.lock b/Cargo.lock
index 265f179..6cbfbb1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -259,7 +259,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
 
 [[package]]
 name = "finlib"
-version = "0.0.4"
+version = "0.0.5"
 dependencies = [
  "getrandom 0.2.15",
  "log",
@@ -274,7 +274,7 @@ dependencies = [
 
 [[package]]
 name = "finlib-ffi"
-version = "0.0.4"
+version = "0.0.5"
 dependencies = [
  "cbindgen",
  "csbindgen",
@@ -283,7 +283,7 @@ dependencies = [
 
 [[package]]
 name = "finlib-wasm"
-version = "0.0.4"
+version = "0.0.5"
 dependencies = [
  "console_error_panic_hook",
  "console_log",
@@ -606,7 +606,7 @@ dependencies = [
 
 [[package]]
 name = "pyfinlib"
-version = "0.0.4"
+version = "0.0.5"
 dependencies = [
  "finlib",
  "log",
diff --git a/Cargo.toml b/Cargo.toml
index e114ba6..926e95c 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -14,7 +14,7 @@ default-members = [
 ]
 
 [workspace.package]
-version = "0.0.4"
+version = "0.0.5"
 authors = ["sarsoo <andy@sarsoo.xyz>"]
 description = "Quant finance functions implemented in Rust"
 edition = "2021"
diff --git a/FinLib.NET/FinLib/FinLib.csproj b/FinLib.NET/FinLib/FinLib.csproj
index f2b69d9..ca3c365 100644
--- a/FinLib.NET/FinLib/FinLib.csproj
+++ b/FinLib.NET/FinLib/FinLib.csproj
@@ -2,7 +2,7 @@
 
   <PropertyGroup>
     <PackageId>FinLib.NET</PackageId>
-    <Version>0.0.4</Version>
+    <Version>0.0.5</Version>
     <Authors>sarsoo</Authors>
   </PropertyGroup>