FluentUI/scripts/windows-mingw-publish.ps1

35 lines
980 B
PowerShell
Raw Normal View History

2023-04-03 20:04:46 +08:00
[CmdletBinding()]
param (
[string] $archiveName, [string] $targetName
)
# 外部环境变量包括:
# archiveName: ${{ matrix.qt_ver }}-${{ matrix.qt_arch }}
# archiveName: 5.15.2-win64_mingw81
$scriptDir = $PSScriptRoot
$currentDir = Get-Location
Write-Host "currentDir" $currentDir
Write-Host "scriptDir" $scriptDir
function Main() {
2023-09-29 17:22:22 +08:00
New-Item -ItemType Directory dist
2023-04-03 20:04:46 +08:00
# 拷贝exe
2023-09-29 17:22:22 +08:00
Copy-Item bin\release\* dist\ -Force -Recurse | Out-Null
2023-04-03 20:04:46 +08:00
# 拷贝依赖
2023-09-29 17:22:22 +08:00
windeployqt --qmldir . --plugindir dist\plugins --no-translations --compiler-runtime dist\$targetName
2023-04-03 20:04:46 +08:00
# 删除不必要的文件
$excludeList = @("*.qmlc", "*.ilk", "*.exp", "*.lib", "*.pdb")
2023-09-29 17:39:45 +08:00
Remove-Item -Path dist -Include $excludeList -Recurse -Force
2023-04-03 20:04:46 +08:00
# 打包zip
2023-09-29 17:22:22 +08:00
Compress-Archive -Path dist $archiveName'.zip'
2023-04-03 20:04:46 +08:00
}
if ($null -eq $archiveName || $null -eq $targetName) {
Write-Host "args missing, archiveName is" $archiveName ", targetName is" $targetName
return
}
Main