Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove logging in push to powershell gallery #407

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions build/psgallery-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ stages:
env:
SCRIPT_PATH: '$(Build.SourcesDirectory)\build\tools\psd1-to-nuspec.ps1'
- task: NuGetCommand@2
displayName: 'NuGet Pack'
inputs:
command: 'pack'
packagesToPack: '**/*.nuspec'
Expand All @@ -151,20 +152,10 @@ stages:
inputs:
checkLatest: true
- powershell: |
New-Item log.txt
$nugetPackageFiles = Get-ChildItem -Path $env:ARTIFACT_DIR -Filter *.nupkg -Recurse

foreach ($nugetPackageFile in $nugetPackageFiles) {
$fullFileName = $nugetPackageFile.FullName
Write-Host "Processing '$fullFileName'"
% { & "nuget" push $fullFileName -Source $(Source) -ApiKey $(NuGet.ApiKey) -SkipDuplicate | Out-File log.txt -Append }
}

$log = Get-Content log.txt
cat $log
if ($log -match "BadRequest") {
echo "##vso[task.logissue type=error]Not all PowerShell modules were pushed correctly to the PowerShell Gallery"
exit 1
% { & "nuget" push $fullFileName -Source $(Source) -ApiKey $(NuGet.ApiKey) -SkipDuplicate }
}
displayName: 'Push to PowerShell Gallery'
env:
Expand Down