use powershell and revert change in post_build.ps1

This commit is contained in:
Hongtao Zhang 2025-03-26 22:01:53 -05:00
parent 2868c7256e
commit f26d5632c8
2 changed files with 10 additions and 12 deletions

View file

@ -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

View file

@ -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