diff --git a/Taskfile.yml b/Taskfile.yml index ff550a9..c188757 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -63,7 +63,7 @@ tasks: - for: matrix: KIND: [basic, banana, potato] - cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/sunvalley-{{.ITEM.KIND}} -DestinationPath dist/sunvalley-{{.ITEM.KIND}}.zip"' + cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/sunvalley-{{.ITEM.KIND}} -DestinationPath dist/sunvalley-{{.ITEM.KIND}}.zip -Force"' compress-forest: cmds: @@ -71,7 +71,7 @@ tasks: matrix: KIND: [basic, banana, potato] THEME: [light, dark] - cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/forest-{{.ITEM.KIND}}-{{.ITEM.THEME}} -DestinationPath dist/forest-{{.ITEM.KIND}}-{{.ITEM.THEME}}.zip"' + cmd: '{{.SHELL}} -Command "Compress-Archive -Path dist/forest-{{.ITEM.KIND}}-{{.ITEM.THEME}} -DestinationPath dist/forest-{{.ITEM.KIND}}-{{.ITEM.THEME}}.zip -Force"' clean: desc: Clean up build and dist directories diff --git a/build.ps1 b/build.ps1 deleted file mode 100644 index 2b43d46..0000000 --- a/build.ps1 +++ /dev/null @@ -1,41 +0,0 @@ -param( - [Parameter(Mandatory = $true)] - [string]$prefix, - [string]$theme -) - -function Format-SpecName { - param( - [string]$Kind - ) - return @( - $prefix, - $Kind, - (& { if ($theme) { $theme } else { "" } }) - ).Where({ $_ -ne "" }) -Join "-" -} - -function Compress-Builds { - $target = Join-Path -Path $PSScriptRoot -ChildPath "dist" - @("basic", "banana", "potato") | ForEach-Object { - $compressPath = Format-SpecName -Kind $_ - Compress-Archive -Path (Join-Path -Path $target -ChildPath $compressPath) -DestinationPath (Join-Path -Path $target -ChildPath "${compressPath}.zip") -Force - } -} - -function Get-Builds { - @("basic", "banana", "potato") | ForEach-Object { - $specName = Format-SpecName -Kind $_ - - Write-Host "building $specName" - - poetry 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 } \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 01ee680..7cdf803 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,9 +38,14 @@ requires = ["poetry-core>=2.0.0,<3.0.0"] build-backend = "poetry.core.masonry.api" [tool.poe.tasks] -build_sunvalley.script = "scripts:build_sunvalley" -build_forest.script = "scripts:build_forest" -build_all.script = "scripts:build_all" +build-sunvalley = "task build-sunvalley" +build-forest = "task build-forest" +release = [ + { ref = "build-sunvalley" }, + { ref = "build-forest" }, + { cmd = "task compress-sunvalley" }, + { cmd = "task compress-forest" }, +] [tool.ruff] exclude = [ diff --git a/scripts.py b/scripts.py deleted file mode 100644 index 6879038..0000000 --- a/scripts.py +++ /dev/null @@ -1,24 +0,0 @@ -import subprocess -import sys -from pathlib import Path - - -def build_sunvalley(): - buildscript = Path.cwd() / 'build.ps1' - subprocess.run(['powershell', str(buildscript), 'sunvalley']) - - -def build_forest(): - rewriter = Path.cwd() / 'tools' / 'rewriter.py' - subprocess.run([sys.executable, str(rewriter), '--rewrite']) - - buildscript = Path.cwd() / 'build.ps1' - for theme in ('light', 'dark'): - subprocess.run(['powershell', str(buildscript), 'forest', theme]) - - subprocess.run([sys.executable, str(rewriter), '--restore']) - - -def build_all(): - steps = (build_sunvalley, build_forest) - [step() for step in steps]