This document outlines the steps to build, test, and publish a package to NuGet.
# System setup
To begin, install the .NET SDK: https://dotnet.microsoft.com/en-us/download
# Compile USearch
Collect the USearch libraries for all target runtimes: Linux, Windows, macOS. Place these libraries in the ./lib/runtimes/{RID}/native/ directory, where RID stands for Runtime Identifier. For more information on RIDs, visit [official documentation](https://learn.microsoft.com/en-us/dotnet/core/rid-catalog).
To obtain all libraries, download the artifacts generated by the GitHub workflow and place them in the `lib` folder.
To get a library for your current platform (Linux or Macos), execute: `./eng/build_lib.sh`.
For more details, refer to the [compilation guide](https://github.com/unum-cloud/usearch/blob/main/docs/compilation.md).
# Build and Test
## Using dotnet CLI:
dotnet build -c Release
dotnet test -c Release --no-build
## Using script:
For Linux/macOS, run: `./build_and_test.sh`
For Windows, run: `build_and_test.cmd`
# Push to NuGet
ℹ️ **Note**
For test, use the NuGet test server: https://apiint.nugettest.org/v3/index.json
For release, use: https://api.nuget.org/v3/index.json
## Using dotnet CLI
To pack specify `PACKAGE_VERSION` and run:
dotnet pack -c Release -p:Version="${PACKAGE_VERSION}"
To publish, set `PACKAGE_VERSION`, `NUGET_APIKEY`, and `NUGET_SERVER`, then run:
dotnet nuget push "./packages/Cloud.Unum.USearch.${PACKAGE_VERSION}.nupkg" -k ${NUGET_APIKEY} -s ${NUGET_SERVER}
## Using script
Run the script to clear `packages` folder of older artifacts, then builds and pushes project:
PACKAGE_ID= PACKAGE_VERSION= NUGET_APIKEY= NUGET_SERVER= ./pack.sh