feat: versioning, feat: in app configueration, feat: single exe, feat: reasoning, action: inital version, fix: config saving
Build Release EXE / build-windows-exe (release) Successful in 1m5s
Build Release EXE / build-windows-exe (release) Successful in 1m5s
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$Root = Split-Path -Parent $PSScriptRoot
|
||||
Set-Location $Root
|
||||
|
||||
$Python = Join-Path $Root ".venv\Scripts\python.exe"
|
||||
if (-not (Test-Path $Python)) {
|
||||
$Python = "python"
|
||||
}
|
||||
|
||||
& $Python -m ensurepip --upgrade
|
||||
& $Python -m pip install -e ".[dev]"
|
||||
& $Python -m PyInstaller --clean "TraderAI.spec"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Built dist\TraderAI.exe"
|
||||
@@ -0,0 +1,29 @@
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[ValidatePattern('^v?\d+\.\d+\.\d+([-.+][0-9A-Za-z.-]+)?$')]
|
||||
[string]$Version
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$repoRoot = Resolve-Path -LiteralPath (Join-Path $PSScriptRoot "..")
|
||||
$cleanVersion = $Version.TrimStart("v")
|
||||
|
||||
$pyprojectPath = Join-Path $repoRoot "pyproject.toml"
|
||||
$versionPath = Join-Path $repoRoot "traderai\version.py"
|
||||
$lockPath = Join-Path $repoRoot "uv.lock"
|
||||
|
||||
$pyproject = Get-Content -LiteralPath $pyprojectPath -Raw
|
||||
$pyproject = $pyproject -replace '(?m)^version = "[^"]+"', "version = `"$cleanVersion`""
|
||||
Set-Content -LiteralPath $pyprojectPath -Value $pyproject -Encoding UTF8
|
||||
|
||||
$versionModule = Get-Content -LiteralPath $versionPath -Raw
|
||||
$versionModule = $versionModule -replace '__version__ = "[^"]+"', "__version__ = `"$cleanVersion`""
|
||||
Set-Content -LiteralPath $versionPath -Value $versionModule -Encoding UTF8
|
||||
|
||||
if (Test-Path -LiteralPath $lockPath) {
|
||||
$lock = Get-Content -LiteralPath $lockPath -Raw
|
||||
$lock = $lock -replace '(?s)(name = "traderai"\s+version = ")[^"]+(")', "`${1}$cleanVersion`${2}"
|
||||
Set-Content -LiteralPath $lockPath -Value $lock -Encoding UTF8
|
||||
}
|
||||
|
||||
Write-Host "TraderAI version set to $cleanVersion"
|
||||
Reference in New Issue
Block a user