Spaces:
Running
Running
Download scripts/build_windows_bundle.ps1 from BravoRobots/lexia: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/spaces/BravoRobots/lexia/resolve/main/scripts/build_windows_bundle.ps1
- Command line
-
hf download hf://spaces/BravoRobots/lexia/scripts/build_windows_bundle.ps1
-
curl -L -o build_windows_bundle.ps1 https://huggingface.co/spaces/BravoRobots/lexia/resolve/main/scripts/build_windows_bundle.ps1
1.38 kB
| # Genera el .zip transportable: instalador + wheel + huellas. | |
| param([string]$Salida = "runtime") | |
| $ErrorActionPreference = "Stop" | |
| $raiz = Split-Path -Parent (Split-Path -Parent $MyInvocation.MyCommand.Path) | |
| $version = (Select-String -Path (Join-Path $raiz "pyproject.toml") -Pattern '^version = "(.+)"').Matches[0].Groups[1].Value | |
| $bundle = Join-Path $raiz "$Salida\windows-bundle" | |
| Remove-Item -LiteralPath $bundle -Recurse -Force -ErrorAction SilentlyContinue | |
| New-Item -ItemType Directory -Path (Join-Path $bundle "payload") -Force | Out-Null | |
| Push-Location $raiz | |
| python -m pip install --quiet build | |
| python -m build --wheel --outdir (Join-Path $raiz "dist") | |
| Pop-Location | |
| $wheel = Get-ChildItem (Join-Path $raiz "dist") -Filter "lexia-$version-*.whl" | | |
| Sort-Object LastWriteTime -Descending | Select-Object -First 1 | |
| Copy-Item $wheel.FullName (Join-Path $bundle "payload") | |
| Copy-Item (Join-Path $raiz "installer\*") $bundle | |
| Get-ChildItem -LiteralPath (Join-Path $bundle "payload") -File | ForEach-Object { | |
| "$((Get-FileHash $_.FullName -Algorithm SHA256).Hash.ToLower()) $($_.Name)" | |
| } | Set-Content (Join-Path $bundle "SHA256SUMS.txt") | |
| $zip = Join-Path $raiz "$Salida\LexIA-Windows-$version.zip" | |
| Remove-Item -LiteralPath $zip -Force -ErrorAction SilentlyContinue | |
| Compress-Archive -Path (Join-Path $bundle "*") -DestinationPath $zip | |
| Write-Host "Paquete listo: $zip" | |