develop #1

Open
maddo wants to merge 126 commits from develop into master
Showing only changes of commit 4569e001c8 - Show all commits

Update NuGet auth to use CI_JOB_TOKEN in CI scripts

Switched private NuGet source authentication in build_windows and publish_release jobs to use CI_JOB_TOKEN instead of NUGET_USERNAME/NUGET_PASSWORD. Updated related log messages and ensured PowerShell variable usage is correct for environment variables. This improves compatibility with GitLab CI best practices.
MaddoScientisto 2026-02-16 23:54:32 +01:00

View file

@ -44,14 +44,14 @@ build_windows:
$dotnetExe = 'dotnet'
}
# Configure private NuGet source from GitLab Packages if credentials are provided
# Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN
$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 Nuget-GitLab-AIFotoONLUS...'
if ($env:CI_JOB_TOKEN) {
Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...'
try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {}
& $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text
& $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text
} else {
Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.'
Write-Host 'CI_JOB_TOKEN not available; skipping private NuGet source configuration.'
}
& $dotnetExe --info
@ -87,14 +87,14 @@ publish_release:
& $dotnetExe publish "imagecatalog\ImageCatalog 2.csproj" -c $env:BUILD_CONFIG -r win-x64 --self-contained false -o publish
Write-Host "Published to $(pwd)\\publish"
# Configure private NuGet source from GitLab Packages if credentials are provided
# Configure private NuGet source from GitLab Packages using CI_JOB_TOKEN
$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 Nuget-GitLab-AIFotoONLUS...'
if ($env:CI_JOB_TOKEN) {
Write-Host 'Configuring private NuGet source Nuget-GitLab-AIFotoONLUS using CI_JOB_TOKEN...'
try { & $dotnetExe nuget remove source Nuget-GitLab-AIFotoONLUS } catch {}
& $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $CI_JOB_TOKEN --store-password-in-clear-text
& $dotnetExe nuget add source $nugetUrl --name Nuget-GitLab-AIFotoONLUS --username gitlab-ci-token --password $env:CI_JOB_TOKEN --store-password-in-clear-text
} else {
Write-Host 'NUGET_USERNAME/NUGET_PASSWORD not set; skipping private NuGet source configuration.'
Write-Host 'CI_JOB_TOKEN not available; skipping private NuGet source configuration.'
}
# Find first file in publish folder