From e556d74fd1027c518da6623f0e9152930336675e Mon Sep 17 00:00:00 2001 From: MaddoScientisto Date: Mon, 16 Feb 2026 23:12:57 +0100 Subject: [PATCH] Update NuGet source config and add packageSourceMapping Renamed the private NuGet source from 'GitLab' to 'Nuget-GitLab-AIFotoONLUS' in CI scripts for clarity and consistency. Added a repository-level NuGet.Config with packageSourceMapping to ensure only specific private packages are restored from the GitLab feed, preventing 401 errors when restoring public packages from nuget.org. --- .gitlab-ci.yml | 12 ++++++------ NuGet.Config | 30 ++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 NuGet.Config diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 87cac98..96c9831 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,9 +47,9 @@ build_windows: # Configure private NuGet source from GitLab Packages if credentials are provided $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source GitLab...' - try { & $dotnetExe nuget remove source GitLab } catch {} - & $dotnetExe nuget add source $nugetUrl --name GitLab --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' + try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text } else { Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' } @@ -90,9 +90,9 @@ publish_release: # Configure private NuGet source from GitLab Packages if credentials are provided $nugetUrl = 'https://gitlab.com/api/v4/projects/79509532/packages/nuget/index.json' if ($env:NUGET_USERNAME -and $env:NUGET_PASSWORD) { - Write-Host 'Configuring private NuGet source GitLab...' - try { & $dotnetExe nuget remove source GitLab } catch {} - & $dotnetExe nuget add source $nugetUrl --name GitLab --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text + Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS...' + try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {} + & $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username $env:NUGET_USERNAME --password $env:NUGET_PASSWORD --store-password-in-clear-text } else { Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.' } diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 0000000..79cf275 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + +