Add a new online packaging solution, use the form to execute github actions, and reduce the difficulty of packaging.

This commit is contained in:
Tlntin
2023-03-08 22:14:17 +08:00
parent 8f517769c9
commit 54ebb32ce5
4 changed files with 226 additions and 320 deletions

75
script/build_with_pake_cli.ps1 vendored Normal file
View File

@@ -0,0 +1,75 @@
Write-Host "Welcome to use Powershell"
Write-Host "`n======================="
Write-Host "build for windows"
Write-Host "make ture powershell == 7.2.10"
Write-Host "powershell 7.2.10 download url: https://github.com/PowerShell/PowerShell/releases/tag/v7.2.10"
Write-Host "Powershell info in your localhost "
$PSVersionTable
Write-Host "`n=======================`n"
Write-Host "`n======================="
Write-Host "pake parameters is: "
Write-Host "url: " $env:URL
Write-Host "name: " $env:NAME
Write-Host "icon: " $env:ICON
Write-Host "height: " $env:HEIGHT
Write-Host "width: " $env:WIDTH
Write-Host "transparent: " $env:TRANSPARENT
Write-Host "fullscreen: " $env:FULLSCREEN
Write-Host "resize: " $env:RESIZE
Write-Host "is multi arch? only for Mac: " $env:MULTI_ARCH
Write-Host "===========================`n"
# init params
${Params}="node node_modules/pake-cli/cli.js $env:URL --name $env:NAME"
# download icon
if (($null -eq $env:URL) -or ($env:URL -eq "")){
if ($IsLinux) {
curl -L "$env:ICON" -o icon.png
${Params}="${Params} --icon icon.png"
} elseif ($IsMacOS) {
curl -L "$env:ICON" -o icon.icns
${Params}="${Params} --icon icon.icns"
} elseif ($IsWindows) {
curl -L "$env:ICON" -o icon.ico
${Params}="${Params} --icon icon.ico"
} else {
Write-Host "it won't download icon, becase it can't detect you OS system!"
}
}
# height && weight
${Params}="${Params} --height $env:HEIGHT --width $env:WIDTH"
# transparent
if ("$env:TRANSPARENT" -eq "true") {
${Params}="${Params} --transparent"
}
# fullscreen
if ("$env:FULLSCREEN" -eq "true") {
${Params}="${Params} --fullscreen"
}
# resize
if ("$env:FULLSCREEN" -eq "true" ) {
${Params}="${Params} --resize"
}
# multi-arch
if ($env:MULTI_ARCH -eq "true") {
rustup target add aarch64-apple-darwin
${Params}="${Params} --multi-arch"
}
Write-Host "Pake parameters is: ${Params}"
Write-Host "compile...."
Invoke-Expression $Params
# output
if (-not(Test-Path output)) {
New-Item -ItemType Directory -Path "output"
}
Move-Item -Path "$env:NAME.*" -Destination "output/"
Write-Host "Build Success"