Cleanup #61
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@v3 | |
| - name: Setup NuGet | |
| uses: NuGet/setup-nuget@v3 | |
| - name: Restore NuGet packages | |
| run: nuget restore BundleManager.sln | |
| - name: Build solution | |
| run: msbuild BundleManager.sln /m /p:Configuration=Release | |
| - name: Remove debugging symbols | |
| shell: pwsh | |
| run: | | |
| $patterns = @('*.pdb') | |
| foreach ($pattern in $patterns) { | |
| Get-ChildItem -Path . -Recurse -File -Filter $pattern | | |
| Where-Object { $_.FullName -match '\\bin\\Release\\' } | | |
| Remove-Item -Force -ErrorAction SilentlyContinue | |
| } | |
| - name: Remove empty folders recursively | |
| shell: pwsh | |
| run: | | |
| do { | |
| $removed = 0 | |
| $emptyDirs = Get-ChildItem -Path . -Directory -Recurse -ErrorAction SilentlyContinue | | |
| Where-Object { $_.FullName -match '\\bin\\Release(\\|$)' } | | |
| Sort-Object { $_.FullName.Length } -Descending | | |
| Where-Object { | |
| if (-not (Test-Path -LiteralPath $_.FullName -PathType Container)) { | |
| return $false | |
| } | |
| ((Get-ChildItem -LiteralPath $_.FullName -Force -ErrorAction SilentlyContinue | Measure-Object).Count -eq 0) | |
| } | |
| foreach ($dir in $emptyDirs) { | |
| if (Test-Path -LiteralPath $dir.FullName -PathType Container) { | |
| Remove-Item -LiteralPath $dir.FullName -Force -ErrorAction SilentlyContinue | |
| $removed++ | |
| } | |
| } | |
| } while ($removed -gt 0) | |
| - name: Upload build artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: BundleManager-Release | |
| if-no-files-found: warn | |
| path: | | |
| BundleManager/bin/Release/** |