Skip to content

Commit

Permalink
clean nuget package to save disk space (dotnet#5008)
Browse files Browse the repository at this point in the history
  • Loading branch information
frank-dong-ms-zz authored Apr 8, 2020
1 parent e451c80 commit 7e8a664
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build/ci/job-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ jobs:
displayName: Set LD_LIBRARY_PATH for Ubuntu and CentOS to locate Native shared library in current running path
- script: ${{ parameters.buildScript }} -$(_configuration) -buildArch=${{ parameters.architecture }}
displayName: Build
- ${{ if eq(parameters.pool.name, 'Hosted macOS') }}:
- task: Bash@3
inputs:
targetType: inline
script: cd packages;find . -type d -path "*/runtimes/linux-*" -exec rm -rv {} +;find . -type d -path "*/runtimes/win-*" -exec rm -rv {} +;cd ..
displayName: Clean up non-MacOS runtime folders of NuGet Packages to save disk space
- ${{ if eq(parameters.pool.name, 'Hosted Ubuntu 1604') }}:
- task: Bash@3
inputs:
targetType: inline
script: cd packages;find . -type d -path "*/runtimes/osx-*" -exec rm -rv {} +;find . -type d -path "*/runtimes/win-*" -exec rm -rv {} +;cd ..
displayName: Clean up non-Linux runtime folders of NuGet Packages to save disk space
- ${{ if eq(parameters.buildScript, 'build.cmd') }}:
- task: PowerShell@2
inputs:
targetType: inline
script: Get-ChildItem -Path '.\packages\*\runtimes\*' -Recurse | Select -ExpandProperty FullName | Where {$_ -notlike '*\win-*'} | sort length -Descending | Remove-Item -Recurse -Confirm:$false -Force
displayName: Clean up non-Windows runtime folders of NuGet Packages to save disk space
- ${{ if eq(parameters.nightlyBuild, 'true') }}:
- script: $(dotnetPath) restore $(nightlyBuildProjPath)
displayName: Restore nightly build project
Expand Down

0 comments on commit 7e8a664

Please sign in to comment.