chore(release): v2.0.0
This commit is contained in:
parent
a6f33284a7
commit
7fbf34ff2e
81 changed files with 16727 additions and 3280 deletions
66
packaging/build-windows-installer.ps1
Normal file
66
packaging/build-windows-installer.ps1
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$RepoRoot = (Resolve-Path (Join-Path $PSScriptRoot "..")).Path
|
||||
$CargoToml = Get-Content (Join-Path $RepoRoot "Cargo.toml") -Raw
|
||||
if ($CargoToml -match '(?m)^version\s*=\s*"([^"]+)"') {
|
||||
$Version = $Matches[1]
|
||||
} else {
|
||||
throw "Could not parse version from Cargo.toml"
|
||||
}
|
||||
|
||||
$AppExe = Join-Path $RepoRoot "target\release\yandex-music-rs.exe"
|
||||
$CargoArgs = @("build", "--release", "--bin", "yandex-music-rs")
|
||||
$RunningLocked = Get-Process -Name "yandex-music-rs" -ErrorAction SilentlyContinue |
|
||||
Where-Object { $_.Path -eq $AppExe }
|
||||
if ($RunningLocked) {
|
||||
$StageTarget = Join-Path $RepoRoot "target\installer-stage"
|
||||
Write-Host " (target\release\yandex-music-rs.exe is running; staging into target\installer-stage)" -ForegroundColor DarkGray
|
||||
$CargoArgs += @("--target-dir", $StageTarget)
|
||||
$AppExe = Join-Path $StageTarget "release\yandex-music-rs.exe"
|
||||
}
|
||||
|
||||
Write-Host "==> Building yandex-music-rs v$Version (release)..." -ForegroundColor Yellow
|
||||
Push-Location $RepoRoot
|
||||
try {
|
||||
& cargo @CargoArgs
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
if (-not (Test-Path $AppExe)) {
|
||||
throw "Expected app binary not found: $AppExe"
|
||||
}
|
||||
|
||||
Write-Host "==> Building Windows GUI installer (yandex-music-rs-setup.exe)..." -ForegroundColor Yellow
|
||||
$InstallerDir = Join-Path $RepoRoot "packaging\windows\installer"
|
||||
$env:YM_PAYLOAD_EXE = $AppExe
|
||||
Push-Location $InstallerDir
|
||||
try {
|
||||
& cargo build --release
|
||||
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
$SetupExe = Join-Path $InstallerDir "target\release\yandex-music-rs-setup.exe"
|
||||
if (-not (Test-Path $SetupExe)) {
|
||||
throw "Expected installer binary not found: $SetupExe"
|
||||
}
|
||||
|
||||
$DistDir = Join-Path $RepoRoot "target\release-dist-v$Version"
|
||||
New-Item -ItemType Directory -Force -Path $DistDir | Out-Null
|
||||
|
||||
$OutPortable = Join-Path $DistDir "yandex-music-rs-v$Version-windows-x86_64.exe"
|
||||
$OutSetup = Join-Path $DistDir "yandex-music-rs-v$Version-windows-x86_64-setup.exe"
|
||||
|
||||
Copy-Item -Force $AppExe $OutPortable
|
||||
Copy-Item -Force $SetupExe $OutSetup
|
||||
|
||||
$pSize = [math]::Round((Get-Item $OutPortable).Length / 1MB, 2)
|
||||
$sSize = [math]::Round((Get-Item $OutSetup).Length / 1MB, 2)
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Done!" -ForegroundColor Green
|
||||
Write-Host " Portable : $OutPortable ($pSize MB)"
|
||||
Write-Host " Installer: $OutSetup ($sSize MB)"
|
||||
Loading…
Add table
Add a link
Reference in a new issue