Need advice on compiling a pure C# solution inside my unity project

I am keeping some of my business logic as pure C# and want it to be compiled into an assembly for use in a bundle available via the package manager.

My project structure is as follows:
Assets/

  • CSharp/
    – Runtime/
    — SourceCSharpFiles.cs
  • Unity/
    – Runtime/
    — SourceUnityFiles.cs
    — Libs/
    ---- CSharp.dll (this will be the compiled output of the Assets/CSharp/** directory)

I publish Assets/Unity/** to my Nexus server to make some code available via the unity package manager

I don’t want another solution off to the side since the files change often and new hires might be confused. I’d love to just structure this in a way that allows a user to simply open up the unity project, modify files, then publish a new version to nexus without having to worry about anything else

Any advice on how to do this?

The best solution I have so far is to leave my C# code library marked to only be referenced in the editor and then during the publish step I need to copy the dll from the Library folder into the staging area before the publish happens

Still would be nice to know if there is a better way, but that is what I have so far