call task from pdm

remove build.ps1
This commit is contained in:
Onyx and Iris 2025-02-13 16:47:20 +00:00
parent 9ee0dac610
commit cc0a1de07b
3 changed files with 4 additions and 25 deletions

View File

@ -29,7 +29,7 @@ tasks:
- for:
matrix:
KIND: [basic, banana, potato]
cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/{{.ITEM.KIND}} -DestinationPath dist/{{.ITEM.KIND}}.zip"'
cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/{{.ITEM.KIND}} -DestinationPath dist/{{.ITEM.KIND}}.zip -Force"'
clean:
desc: Clean the project

View File

@ -1,23 +0,0 @@
function Compress-Builds {
$target = Join-Path -Path $PSScriptRoot -ChildPath "dist"
@("basic", "banana", "potato") | ForEach-Object {
Compress-Archive -Path $(Join-Path -Path $target -ChildPath $_) -DestinationPath $(Join-Path -Path $target -ChildPath "${_}.zip") -Force
}
}
function Get-Builds {
@("basic", "banana", "potato") | ForEach-Object {
$specName = $_
Write-Host "building $specName"
pdm run pyinstaller --noconfirm --distpath (Join-Path -Path "dist" -ChildPath $specName) (Join-Path -Path "spec" -ChildPath "${specName}.spec")
}
}
function main {
Get-Builds
Compress-Builds
}
if ($MyInvocation.InvocationName -ne '.') { main }

View File

@ -31,7 +31,9 @@ build-backend = "pdm.backend"
distribution = true
[tool.pdm.scripts]
build = {shell = "pwsh build.ps1"}
build = {shell = "task build"}
compress = {shell = "task compress"}
release = {composite = ["build", "compress"]}
[tool.ruff]
exclude = [