Einstellungen-Tab, plattformuebergreifendes Update/Branding, CI-Release-Pipeline
- Settings-Tab in der App (Discord/Update/Start-Tab live editierbar, kein config.json-Handbearbeiten noetig) - updater.py: plattformabhaengige Asset-Auswahl + Installation (Windows .zip/robocopy, Linux .tar.gz/Shell-Skript) - browser.py/chrome_shim.py: Sec-CH-UA + navigator.userAgentData jetzt je nach sys.platform (Windows/Linux/macOS) - app_id.py: robustere Suche nach umbenanntem QtWebEngine-Hilfsprozess (rglob statt fixer Pfade) - packaging/playtube.spec: icon/version nur unter Windows setzen (Linux-Build faehig) - packaging/install-linux.sh: Installationsskript fuer native Linux-Version (Desktop-Eintrag, Icon, PATH) - .github/workflows/release.yml: baut bei Tag-Push automatisch Windows-.exe UND Linux-Binary und veroeffentlicht beide als GitHub Release Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
+11
-46
@@ -1,21 +1,17 @@
|
||||
# Baut eine neue Playtube-Version, taggt und veroeffentlicht sie als GitHub Release
|
||||
# unter https://github.com/fojadrachi/Playtube - Playtube.exe erkennt neue Releases
|
||||
# danach automatisch (siehe playtube/updater.py) und bietet dem Nutzer die Installation
|
||||
# per Update-Dialog an.
|
||||
# Veroeffentlicht eine neue Playtube-Version: setzt die Versionsnummer, committet,
|
||||
# taggt und pusht. Der eigentliche Build fuer Windows UND Linux sowie die
|
||||
# Veroeffentlichung als GitHub Release passiert danach automatisch per GitHub Actions
|
||||
# (.github/workflows/release.yml), ausgeloest durch den gepushten Tag.
|
||||
#
|
||||
# Aufruf (im Projekt-Root, mit aktivierter venv):
|
||||
# Aufruf (im Projekt-Root):
|
||||
# powershell -ExecutionPolicy Bypass -File packaging\release.ps1 -Version 1.1.0
|
||||
#
|
||||
# Voraussetzungen:
|
||||
# - git remote "origin" zeigt auf https://github.com/fojadrachi/Playtube
|
||||
# - Entweder die GitHub-CLI "gh" ist installiert und eingeloggt (gh auth login),
|
||||
# oder die Umgebungsvariable GITHUB_TOKEN enthaelt ein Personal Access Token mit
|
||||
# "repo"-Rechten (dann wird die GitHub REST API direkt per curl angesprochen).
|
||||
# Voraussetzung: git remote "origin" zeigt auf https://github.com/fojadrachi/Playtube
|
||||
# und du bist dort push-berechtigt.
|
||||
|
||||
param(
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$Version,
|
||||
[string]$Notes = ""
|
||||
[string]$Version
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
@@ -31,19 +27,6 @@ Write-Host "==> Setze Version auf $Version in playtube/__init__.py" -ForegroundC
|
||||
$initFile = Join-Path $root "playtube\__init__.py"
|
||||
(Get-Content $initFile) -replace '__version__ = ".*"', "__version__ = `"$Version`"" | Set-Content $initFile -Encoding utf8
|
||||
|
||||
Write-Host "==> Baue Playtube.exe ..." -ForegroundColor Cyan
|
||||
& (Join-Path $PSScriptRoot "build.ps1")
|
||||
|
||||
$distDir = Join-Path $root "dist\Playtube"
|
||||
if (-not (Test-Path $distDir)) { throw "Build fehlgeschlagen: $distDir nicht gefunden." }
|
||||
|
||||
$zipName = "Playtube-$tag-win64.zip"
|
||||
$zipPath = Join-Path $root "dist\$zipName"
|
||||
if (Test-Path $zipPath) { Remove-Item $zipPath -Force }
|
||||
|
||||
Write-Host "==> Packe $zipName ..." -ForegroundColor Cyan
|
||||
Compress-Archive -Path $distDir -DestinationPath $zipPath
|
||||
|
||||
Write-Host "==> Commit + Tag $tag ..." -ForegroundColor Cyan
|
||||
git add -A
|
||||
git commit -m "Release $tag" --allow-empty
|
||||
@@ -53,25 +36,7 @@ Write-Host "==> Push zu origin ..." -ForegroundColor Cyan
|
||||
git push origin HEAD
|
||||
git push origin $tag
|
||||
|
||||
$gh = Get-Command gh -ErrorAction SilentlyContinue
|
||||
if ($gh) {
|
||||
Write-Host "==> Erstelle GitHub Release mit gh CLI ..." -ForegroundColor Cyan
|
||||
if ([string]::IsNullOrWhiteSpace($Notes)) { $Notes = "Playtube $tag" }
|
||||
gh release create $tag $zipPath --title "Playtube $Version" --notes $Notes
|
||||
} elseif ($env:GITHUB_TOKEN) {
|
||||
Write-Host "==> Erstelle GitHub Release ueber die REST API ..." -ForegroundColor Cyan
|
||||
$repo = "fojadrachi/Playtube"
|
||||
$body = @{ tag_name = $tag; name = "Playtube $Version"; body = $(if ($Notes) { $Notes } else { "Playtube $tag" }) } | ConvertTo-Json
|
||||
$headers = @{ Authorization = "Bearer $($env:GITHUB_TOKEN)"; Accept = "application/vnd.github+json" }
|
||||
$release = Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/releases" -Method Post -Headers $headers -Body $body -ContentType "application/json"
|
||||
$uploadUrl = $release.upload_url -replace '\{\?name,label\}', "?name=$zipName"
|
||||
Invoke-RestMethod -Uri $uploadUrl -Method Post -Headers ($headers + @{ "Content-Type" = "application/zip" }) -InFile $zipPath | Out-Null
|
||||
Write-Host "Release veroeffentlicht: $($release.html_url)" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Warning "Weder 'gh' CLI noch GITHUB_TOKEN gefunden - Tag wurde gepusht, aber kein GitHub Release erstellt."
|
||||
Write-Warning "Entweder 'winget install GitHub.cli' + 'gh auth login' ausfuehren und dieses Skript erneut starten,"
|
||||
Write-Warning "oder manuell unter https://github.com/fojadrachi/Playtube/releases/new ein Release fuer Tag '$tag' anlegen und '$zipPath' als Asset anhaengen."
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "Fertig." -ForegroundColor Green
|
||||
Write-Host "Fertig. GitHub Actions baut jetzt Windows- und Linux-Pakete und" -ForegroundColor Green
|
||||
Write-Host "veroeffentlicht sie als Release $tag - Fortschritt unter:" -ForegroundColor Green
|
||||
Write-Host "https://github.com/fojadrachi/Playtube/actions" -ForegroundColor Green
|
||||
|
||||
Reference in New Issue
Block a user