develop #1
1 changed files with 10 additions and 10 deletions
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.
commit
4569e001c8
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue