diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 2e4531645..3e986c603 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -51,7 +51,7 @@ jobs: - name: Test run: dotnet test --no-build --verbosity normal -c Release - name: Perform post_build tasks - shell: pwsh + shell: powershell run: .\Scripts\post_build.ps1 - name: Upload Plugin Nupkg uses: actions/upload-artifact@v4 diff --git a/Scripts/post_build.ps1 b/Scripts/post_build.ps1 index 6f610c99e..e54852d32 100644 --- a/Scripts/post_build.ps1 +++ b/Scripts/post_build.ps1 @@ -1,5 +1,5 @@ param( - [string]$config = "Release", + [string]$config = "Release", [string]$solution = (Join-Path $PSScriptRoot ".." -Resolve) ) Write-Host "Config: $config" @@ -40,13 +40,11 @@ function Delete-Unused ($path, $config) { $target = "$path\Output\$config" $included = Get-ChildItem $target -Filter "*.dll" foreach ($i in $included){ - foreach ($plugin in Get-ChildItem $target\Plugins){ - $deleteList = Get-ChildItem $plugin -Filter $i.Name | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq $i.Name } - $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } - $deleteList | Remove-Item - } + $deleteList = Get-ChildItem $target\Plugins -Include $i -Recurse | Where { $_.VersionInfo.FileVersion -eq $i.VersionInfo.FileVersion -And $_.Name -eq "$i" } + $deleteList | ForEach-Object{ Write-Host Deleting duplicated $_.Name with version $_.VersionInfo.FileVersion at location $_.Directory.FullName } + $deleteList | Remove-Item } - Remove-Item -Path $target -Include "*.xml" -Recurse + Remove-Item -Path $target -Include "*.xml" -Recurse } function Remove-CreateDumpExe ($path, $config) { @@ -89,7 +87,7 @@ function Pack-Squirrel-Installer ($path, $version, $output) { Squirrel --releasify $nupkg --releaseDir $temp --setupIcon $icon --no-msi | Write-Output Move-Item $temp\* $output -Force Remove-Item $temp - + $file = "$output\Flow-Launcher-Setup.exe" Write-Host "Filename: $file" @@ -109,7 +107,7 @@ function Publish-Self-Contained ($p) { } function Publish-Portable ($outputLocation, $version) { - + & $outputLocation\Flow-Launcher-Setup.exe --silent | Out-Null mkdir "$env:LocalAppData\FlowLauncher\app-$version\UserData" Compress-Archive -Path $env:LocalAppData\FlowLauncher -DestinationPath $outputLocation\Flow-Launcher-Portable.zip @@ -121,7 +119,7 @@ function Main { Copy-Resources $p if ($config -eq "Release"){ - + Delete-Unused $p $config Publish-Self-Contained $p @@ -136,4 +134,4 @@ function Main { } } -Main +Main \ No newline at end of file