Skip to content

Commit

Permalink
feat: reimagining cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yannouuuu committed Aug 9, 2024
1 parent 58986f0 commit 5658274
Showing 1 changed file with 9 additions and 32 deletions.
41 changes: 9 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,15 @@ jobs:
run: |
$releasePath = "zed/target/release"
if (Test-Path $releasePath) {
# Clean up .exe files
Get-ChildItem -Path $releasePath -Filter "Zed*.exe" |
Where-Object { $_.Name -ne "Zed-windows-amd64-$env:LATEST_TAG.exe" -and $_.Name -ne "Zed.exe" } |
ForEach-Object {
Remove-Item $_.FullName -Force
Write-Host "Removed old artifact: $($_.Name)"
}
if (Test-Path "$releasePath/Zed.exe") {
Remove-Item "$releasePath/Zed.exe" -Force
Write-Host "Removed Zed.exe"
}
if (Test-Path "$releasePath/Zed-windows-amd64-$env:LATEST_TAG.exe") {
Remove-Item "$releasePath/Zed-windows-amd64-$env:LATEST_TAG.exe" -Force
Write-Host "Removed Zed-windows-amd64-$env:LATEST_TAG.exe"
}
# Clean up .msix files
Get-ChildItem -Path $releasePath -Filter "*.msix" | ForEach-Object {
Remove-Item $_.FullName -Force
Write-Host "Removed old .msix file: $($_.Name)"
}
# Clean up .msixbundle files
Get-ChildItem -Path $releasePath -Filter "*.msixbundle" | ForEach-Object {
Remove-Item $_.FullName -Force
Write-Host "Removed old .msixbundle file: $($_.Name)"
}
# Clean up .appinstaller files
Get-ChildItem -Path $releasePath -Filter "*.appinstaller" | ForEach-Object {
Remove-Item $_.FullName -Force
Write-Host "Removed old .appinstaller file: $($_.Name)"
# Define file extensions to remove
$extensionsToRemove = @("*.exe", "*.msix", "*.msixbundle", "*.appinstaller")
# Remove files with specified extensions
foreach ($extension in $extensionsToRemove) {
Get-ChildItem -Path $releasePath -Filter $extension | ForEach-Object {
Remove-Item $_.FullName -Force
Write-Host "Removed file: $($_.Name)"
}
}
# List remaining contents of the release directory
Expand Down

0 comments on commit 5658274

Please sign in to comment.