Skip to content

Commit

Permalink
feat: inherited msix-build branch cleanup method
Browse files Browse the repository at this point in the history
  • Loading branch information
yannouuuu committed Aug 9, 2024
1 parent 60d205a commit 65c01fe
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,32 @@ jobs:
# Clean up old build artifacts
- name: Clean up old build artifacts
run: |
$latestTag = (Invoke-RestMethod -Uri https://api.github.com/repos/zed-industries/zed/releases | ForEach-Object { $_.tag_name } | Select-Object -First 1)
$oldArtifacts = Get-ChildItem -Path "target/release" -Filter "Zed-windows-amd64-*.exe"
foreach ($artifact in $oldArtifacts) {
if ($artifact.Name -ne "Zed-windows-amd64-$latestTag.exe") {
Remove-Item $artifact.FullName -Force
Write-Host "Removed old artifact: $($artifact.Name)"
$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"
}
# List remaining contents of the release directory
Write-Host "Remaining contents of ${releasePath}:"
Get-ChildItem -Path $releasePath | ForEach-Object {
Write-Host " $($_.Name)"
}
} else {
Write-Host "Release directory does not exist yet: ${releasePath}"
}y
# Build Zed
- run: cargo build --release -j 4
- run: copy target/release/Zed.exe target/release/Zed-windows-amd64.exe
Expand Down

0 comments on commit 65c01fe

Please sign in to comment.