Catalog/NuGet.Config

30 lines
1.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Repository-level NuGet.Config to control which sources are queried for which
packages. This prevents the Forgejo feed from being queried for all package
IDs (which causes 401 errors for packages hosted on nuget.org).
Usage:
- Keep this file in the repository root so `dotnet restore` picks it up by default.
- CI still needs to add the `Forgejo` source credentials at runtime (we do this
from the pipeline using `dotnet nuget add source ...`), but the mapping below
ensures only the listed package ID patterns are requested from the Forgejo feed.
-->
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="Nuget-Forgejo-AIFotoONLUS" value="https://forgejo.maddoscientisto.net/api/packages/maddo/nuget/index.json" />
</packageSources>
<!-- Map private package IDs to the Forgejo source; everything else uses nuget.org -->
<packageSourceMapping>
<packageSource key="Nuget-Forgejo-AIFotoONLUS">
<!-- Add patterns for your private packages hosted in Forgejo -->
<package pattern="AIFotoONLUS.*" />
<package pattern="AIFotoONLUS.Core" />
</packageSource>
<packageSource key="nuget.org">
<package pattern="*" />
</packageSource>
</packageSourceMapping>
</configuration>