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:
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
# Installiert eine entpackte Playtube-Linux-Version (aus dem Playtube-vX.Y.Z-linux-x86_64.tar.gz
|
||||
# Release-Paket) als "richtige" Desktop-App: eigener Ordner unter ~/.local/share/Playtube,
|
||||
# Startmenue-Eintrag mit Icon, Kommandozeilen-Befehl "playtube".
|
||||
#
|
||||
# Aufruf: im entpackten Ordner (der die Datei "Playtube" enthaelt) ausfuehren:
|
||||
# sh install-linux.sh
|
||||
|
||||
set -e
|
||||
|
||||
SRC_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
INSTALL_DIR="$HOME/.local/share/Playtube"
|
||||
BIN_DIR="$HOME/.local/bin"
|
||||
DESKTOP_DIR="$HOME/.local/share/applications"
|
||||
ICON_DIR="$HOME/.local/share/icons/hicolor/512x512/apps"
|
||||
|
||||
if [ ! -f "$SRC_DIR/Playtube" ]; then
|
||||
echo "Fehler: $SRC_DIR/Playtube nicht gefunden - bitte im entpackten Release-Ordner ausfuehren." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "==> Installiere nach $INSTALL_DIR ..."
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
cp -a "$SRC_DIR"/. "$INSTALL_DIR"/
|
||||
chmod +x "$INSTALL_DIR/Playtube"
|
||||
|
||||
mkdir -p "$BIN_DIR"
|
||||
ln -sf "$INSTALL_DIR/Playtube" "$BIN_DIR/playtube"
|
||||
|
||||
mkdir -p "$ICON_DIR"
|
||||
if [ -f "$INSTALL_DIR/assets/icon.png" ]; then
|
||||
cp -f "$INSTALL_DIR/assets/icon.png" "$ICON_DIR/playtube.png"
|
||||
fi
|
||||
|
||||
mkdir -p "$DESKTOP_DIR"
|
||||
cat > "$DESKTOP_DIR/playtube.desktop" <<EOF
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Playtube
|
||||
Comment=YouTube & YouTube Music mit Discord Rich Presence
|
||||
Exec=$INSTALL_DIR/Playtube
|
||||
Icon=playtube
|
||||
Terminal=false
|
||||
Categories=AudioVideo;Audio;Video;Network;
|
||||
StartupWMClass=Playtube
|
||||
EOF
|
||||
|
||||
update-desktop-database "$DESKTOP_DIR" 2>/dev/null || true
|
||||
gtk-update-icon-cache "$HOME/.local/share/icons/hicolor" 2>/dev/null || true
|
||||
|
||||
echo ""
|
||||
echo "Fertig! Playtube ist jetzt im Anwendungsmenue verfuegbar,"
|
||||
echo "oder direkt per Terminal-Befehl 'playtube' startbar"
|
||||
echo "(ggf. $BIN_DIR zum PATH hinzufuegen, falls das nicht klappt)."
|
||||
@@ -25,10 +25,9 @@ a = Analysis(
|
||||
|
||||
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)
|
||||
|
||||
exe = EXE(
|
||||
pyz,
|
||||
a.scripts,
|
||||
[],
|
||||
# icon/version-Ressourcen sind Windows-spezifisch (.ico + Versionsressource) - unter
|
||||
# Linux/macOS gibt es diese Konzepte fuer ELF-Binaries nicht, deshalb nur dort setzen.
|
||||
exe_kwargs = dict(
|
||||
exclude_binaries=True,
|
||||
name="Playtube",
|
||||
debug=False,
|
||||
@@ -36,9 +35,12 @@ exe = EXE(
|
||||
strip=False,
|
||||
upx=False,
|
||||
console=False,
|
||||
icon=str(ROOT / "assets" / "icon.ico"),
|
||||
version=str(ROOT / "packaging" / "version_info.txt"),
|
||||
)
|
||||
if sys.platform == "win32":
|
||||
exe_kwargs["icon"] = str(ROOT / "assets" / "icon.ico")
|
||||
exe_kwargs["version"] = str(ROOT / "packaging" / "version_info.txt")
|
||||
|
||||
exe = EXE(pyz, a.scripts, [], **exe_kwargs)
|
||||
|
||||
coll = COLLECT(
|
||||
exe,
|
||||
|
||||
+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