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.
This commit is contained in:
MaddoScientisto 2026-02-16 23:12:57 +01:00
commit e556d74fd1
2 changed files with 36 additions and 6 deletions

View file

@ -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.'
}