feat: unabhaengig von GitHub - Updater und Releases ueber eigenes Gitea
Release (Edge) / release (push) Waiting to run
Release (Edge) / release (push) Waiting to run
This commit is contained in:
@@ -0,0 +1,78 @@
|
|||||||
|
name: Release (Edge)
|
||||||
|
|
||||||
|
# Baut Playtube Edge (Microsoft-Edge-Engine / WebView2) fuer Windows und veroeffentlicht Setup
|
||||||
|
# und ZIP als Release auf dem eigenen Gitea-Server, sobald ein Tag im Format "vX.Y.Z-edge"
|
||||||
|
# gepusht wird (z.B. durch packaging/release.ps1).
|
||||||
|
#
|
||||||
|
# WICHTIG:
|
||||||
|
# - Nur Tags mit dem Suffix "-edge" loesen diesen Workflow aus - die normale (Qt-)Playtube
|
||||||
|
# baut aus dem Branch "main" mit Tags "vX.Y.Z" und bleibt davon unberuehrt.
|
||||||
|
# - Das Release wird als VORABVERSION veroeffentlicht. Der Updater der normalen Playtube
|
||||||
|
# ignoriert Vorabversionen und Tags mit "-edge"; der Updater der Edge-Version sucht seinerseits
|
||||||
|
# nur nach Tags "...-edge" (siehe playtube/updater.py).
|
||||||
|
#
|
||||||
|
# Voraussetzungen (einmalig, siehe README "Releases bauen"):
|
||||||
|
# - Gitea-Actions-Runner unter Windows mit Label "windows" (Host-Modus) mit Python 3.12, git,
|
||||||
|
# PowerShell und Inno Setup 6.
|
||||||
|
# - Repo-Secret "RELEASE_TOKEN" (Zugriffstoken mit Schreibrecht); ersatzweise der automatische Token.
|
||||||
|
# Bewusst KEINE "uses:"-Aktionen: die wuerden standardmaessig von github.com geladen.
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- "v*-edge"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: windows
|
||||||
|
steps:
|
||||||
|
- name: Quellcode holen
|
||||||
|
shell: pwsh
|
||||||
|
run: |
|
||||||
|
git clone "${{ gitea.server_url }}/${{ gitea.repository }}.git" src
|
||||||
|
git -C src checkout "${{ gitea.ref_name }}"
|
||||||
|
|
||||||
|
- name: Abhaengigkeiten installieren
|
||||||
|
shell: pwsh
|
||||||
|
working-directory: src
|
||||||
|
run: |
|
||||||
|
python -m venv .venv
|
||||||
|
.\.venv\Scripts\python.exe -m pip install --upgrade pip
|
||||||
|
.\.venv\Scripts\python.exe -m pip install -r requirements.txt pyinstaller
|
||||||
|
|
||||||
|
- name: PlaytubeEdge.exe bauen
|
||||||
|
shell: pwsh
|
||||||
|
working-directory: src
|
||||||
|
run: .\.venv\Scripts\python.exe -m PyInstaller packaging\playtube.spec --noconfirm --distpath dist --workpath build
|
||||||
|
|
||||||
|
- name: Setup-Installer bauen (Inno Setup)
|
||||||
|
shell: pwsh
|
||||||
|
working-directory: src
|
||||||
|
run: |
|
||||||
|
$version = (Select-String -Path playtube\__init__.py -Pattern '__version__\s*=\s*"([^"]+)"').Matches[0].Groups[1].Value
|
||||||
|
$candidates = @(
|
||||||
|
(Get-Command iscc -ErrorAction SilentlyContinue | ForEach-Object { $_.Source }),
|
||||||
|
(Join-Path $env:LOCALAPPDATA "Programs\Inno Setup 6\ISCC.exe"),
|
||||||
|
(Join-Path ${env:ProgramFiles(x86)} "Inno Setup 6\ISCC.exe"),
|
||||||
|
(Join-Path $env:ProgramFiles "Inno Setup 6\ISCC.exe")
|
||||||
|
)
|
||||||
|
$iscc = $candidates | Where-Object { $_ -and (Test-Path $_) } | Select-Object -First 1
|
||||||
|
if (-not $iscc) { throw "Inno Setup 6 ist auf dem Runner nicht installiert." }
|
||||||
|
& $iscc "/DAppVersion=$version" packaging\playtube.iss
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw "Inno-Setup-Build fehlgeschlagen." }
|
||||||
|
|
||||||
|
- name: ZIP packen (portabel)
|
||||||
|
shell: pwsh
|
||||||
|
working-directory: src
|
||||||
|
run: Compress-Archive -Path dist\PlaytubeEdge -DestinationPath "PlaytubeEdge-${{ gitea.ref_name }}-win64.zip"
|
||||||
|
|
||||||
|
- name: Release auf Gitea veroeffentlichen (Vorabversion)
|
||||||
|
shell: pwsh
|
||||||
|
working-directory: src
|
||||||
|
env:
|
||||||
|
GITEA_TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
$tag = "${{ gitea.ref_name }}"
|
||||||
|
$files = @((Get-ChildItem dist\installer\PlaytubeEdge-Setup-v*.exe).FullName) + @((Get-ChildItem "PlaytubeEdge-*-win64.zip").FullName)
|
||||||
|
.\packaging\publish_release.ps1 -Tag $tag -Title "Playtube Edge $tag" -NotesFile packaging\release_notes.md `
|
||||||
|
-Files $files -Prerelease -Server "${{ gitea.server_url }}" -Repo "${{ gitea.repository }}"
|
||||||
@@ -1,90 +0,0 @@
|
|||||||
name: Release (Edge)
|
|
||||||
|
|
||||||
# Baut Playtube Edge (Microsoft-Edge-Engine / WebView2) fuer Windows und veroeffentlicht Setup
|
|
||||||
# und ZIP an einem GitHub Release, sobald ein Tag im Format "vX.Y.Z-edge" gepusht wird.
|
|
||||||
#
|
|
||||||
# WICHTIG:
|
|
||||||
# - Nur Tags mit dem Suffix "-edge" loesen diesen Workflow aus - die normale (Qt-)Playtube
|
|
||||||
# baut aus dem Branch "main" mit Tags "vX.Y.Z" und bleibt davon unberuehrt.
|
|
||||||
# - Das Release wird als VORABVERSION veroeffentlicht und nie als "latest" markiert. Die Qt-
|
|
||||||
# Version fragt "/releases/latest" ab und sieht dieses Release dadurch nie; der Updater der
|
|
||||||
# Edge-Version sucht seinerseits nur nach Tags "...-edge" (siehe playtube/updater.py).
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*-edge"
|
|
||||||
workflow_dispatch: {}
|
|
||||||
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-windows:
|
|
||||||
runs-on: windows-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
|
||||||
with:
|
|
||||||
python-version: "3.12"
|
|
||||||
|
|
||||||
- name: Abhaengigkeiten installieren
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install -r requirements.txt
|
|
||||||
pip install pyinstaller
|
|
||||||
|
|
||||||
- name: PlaytubeEdge.exe bauen
|
|
||||||
run: pyinstaller packaging\playtube.spec --noconfirm --distpath dist --workpath build
|
|
||||||
|
|
||||||
- name: Setup-Installer bauen (Inno Setup)
|
|
||||||
shell: pwsh
|
|
||||||
run: |
|
|
||||||
$version = (Select-String -Path playtube\__init__.py -Pattern '__version__\s*=\s*"([^"]+)"').Matches[0].Groups[1].Value
|
|
||||||
$iscc = Join-Path ${env:ProgramFiles(x86)} "Inno Setup 6\ISCC.exe"
|
|
||||||
if (-not (Test-Path $iscc)) {
|
|
||||||
choco install innosetup -y --no-progress
|
|
||||||
}
|
|
||||||
& $iscc "/DAppVersion=$version" packaging\playtube.iss
|
|
||||||
if ($LASTEXITCODE -ne 0) { throw "Inno-Setup-Build fehlgeschlagen." }
|
|
||||||
|
|
||||||
# Zwei getrennte Artefakte: bei mehreren Pfaden in EINEM Artefakt behielte das Setup seinen
|
|
||||||
# Unterordner (dist/installer/) und wuerde beim Veroeffentlichen nicht gefunden.
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: windows-edge-setup
|
|
||||||
path: dist/installer/PlaytubeEdge-Setup-v*.exe
|
|
||||||
|
|
||||||
- name: Als .zip packen (portabel)
|
|
||||||
run: Compress-Archive -Path dist\PlaytubeEdge -DestinationPath PlaytubeEdge-${{ github.ref_name }}-win64.zip
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: windows-edge-zip
|
|
||||||
path: PlaytubeEdge-*-win64.zip
|
|
||||||
|
|
||||||
publish-release:
|
|
||||||
needs: [build-windows]
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- uses: actions/download-artifact@v4
|
|
||||||
with:
|
|
||||||
path: artifacts
|
|
||||||
merge-multiple: true
|
|
||||||
|
|
||||||
- name: GitHub Release veroeffentlichen (Vorabversion, nie "latest")
|
|
||||||
# gh statt softprops/action-gh-release: letzteres brach beim erneuten Veroeffentlichen
|
|
||||||
# desselben Tags mit "Too many retries" ab. Ein vorhandenes Release zum selben Tag wird
|
|
||||||
# zuerst entfernt (der Tag bleibt), dann sauber neu angelegt.
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
gh release delete "${{ github.ref_name }}" --repo "${{ github.repository }}" --yes || true
|
|
||||||
gh release create "${{ github.ref_name }}" artifacts/* \
|
|
||||||
--repo "${{ github.repository }}" \
|
|
||||||
--title "Playtube Edge ${{ github.ref_name }}" \
|
|
||||||
--notes-file packaging/release_notes.md \
|
|
||||||
--prerelease --latest=false --verify-tag
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
> kein H.264 abspielen kann. Playtube Edge rendert stattdessen mit der **Microsoft-Edge-Engine
|
> kein H.264 abspielen kann. Playtube Edge rendert stattdessen mit der **Microsoft-Edge-Engine
|
||||||
> (WebView2)** – damit laufen auch Uploads.
|
> (WebView2)** – damit laufen auch Uploads.
|
||||||
>
|
>
|
||||||
> - Download: [Releases](https://github.com/fojadrachi/Playtube/releases) → Eintrag „Playtube
|
> - Download: [Releases](https://git.fojadrachi.de/Fojadrachi/Playtube/releases) → Eintrag „Playtube
|
||||||
> Edge vX.Y.Z-edge“ → `PlaytubeEdge-Setup-vX.Y.Z.exe`. Voraussetzung: Windows 10/11 mit
|
> Edge vX.Y.Z-edge“ → `PlaytubeEdge-Setup-vX.Y.Z.exe`. Voraussetzung: Windows 10/11 mit
|
||||||
> WebView2-Runtime (Windows 11: vorinstalliert).
|
> WebView2-Runtime (Windows 11: vorinstalliert).
|
||||||
> - Läuft **neben** der normalen Playtube (eigener Ordner `%APPDATA%\PlaytubeEdge`, eigenes
|
> - Läuft **neben** der normalen Playtube (eigener Ordner `%APPDATA%\PlaytubeEdge`, eigenes
|
||||||
@@ -42,8 +42,8 @@ Erweiterung) mit:
|
|||||||
|
|
||||||
## Installation (Windows)
|
## Installation (Windows)
|
||||||
|
|
||||||
Lade auf der [Releases-Seite](https://github.com/fojadrachi/Playtube/releases)
|
Lade auf der [Releases-Seite](https://git.fojadrachi.de/Fojadrachi/Playtube/releases)
|
||||||
`Playtube-Setup-vX.Y.Z.exe` herunter und starte sie. Der Installer
|
`PlaytubeEdge-Setup-vX.Y.Z.exe` herunter und starte sie. Der Installer
|
||||||
|
|
||||||
- installiert Playtube **pro Benutzer** nach `%LOCALAPPDATA%\Programs\Playtube` (keine
|
- installiert Playtube **pro Benutzer** nach `%LOCALAPPDATA%\Programs\Playtube` (keine
|
||||||
Admin-Rechte nötig) und legt Startmenü-Eintrag (optional Desktop-Verknüpfung) an,
|
Admin-Rechte nötig) und legt Startmenü-Eintrag (optional Desktop-Verknüpfung) an,
|
||||||
@@ -171,7 +171,7 @@ o.ä. umgehen).
|
|||||||
|
|
||||||
Playtube prüft beim Start und danach alle `updates.check_interval_hours` Stunden
|
Playtube prüft beim Start und danach alle `updates.check_interval_hours` Stunden
|
||||||
(Standard 6, im **Einstellungen-Tab** oder in `config.json` einstellbar) die
|
(Standard 6, im **Einstellungen-Tab** oder in `config.json` einstellbar) die
|
||||||
[GitHub Releases](https://github.com/fojadrachi/Playtube/releases) des Projekts. Im
|
[Releases](https://git.fojadrachi.de/Fojadrachi/Playtube/releases) auf dem eigenen Gitea-Server (nur Tags `-edge`). Im
|
||||||
Einstellungen-Tab gibt es zusätzlich einen "Jetzt nach Updates suchen"-Button mit
|
Einstellungen-Tab gibt es zusätzlich einen "Jetzt nach Updates suchen"-Button mit
|
||||||
Status-Anzeige und Fortschrittsbalken für den Download. Gibt es eine neuere Version,
|
Status-Anzeige und Fortschrittsbalken für den Download. Gibt es eine neuere Version,
|
||||||
fragt ein Dialog, ob sie installiert werden soll:
|
fragt ein Dialog, ob sie installiert werden soll:
|
||||||
@@ -212,7 +212,7 @@ Windows-Patch-Pakete tragen die eigene Dateiendung `.play` statt `.zip` (technis
|
|||||||
weiterhin ein ganz normales ZIP-Archiv). Playtube registriert `.play` beim ersten Start
|
weiterhin ein ganz normales ZIP-Archiv). Playtube registriert `.play` beim ersten Start
|
||||||
automatisch als Windows-Dateizuordnung - eine manuell heruntergeladene
|
automatisch als Windows-Dateizuordnung - eine manuell heruntergeladene
|
||||||
`Playtube-vX.Y.Z-win64-patch.play` (z.B. von der
|
`Playtube-vX.Y.Z-win64-patch.play` (z.B. von der
|
||||||
[Releases-Seite](https://github.com/fojadrachi/Playtube/releases)) lässt sich also
|
[Releases-Seite](https://git.fojadrachi.de/Fojadrachi/Playtube/releases)) lässt sich also
|
||||||
einfach per Doppelklick installieren, ohne dass Playtube selbst etwas herunterladen
|
einfach per Doppelklick installieren, ohne dass Playtube selbst etwas herunterladen
|
||||||
muss.
|
muss.
|
||||||
|
|
||||||
@@ -223,12 +223,32 @@ powershell -ExecutionPolicy Bypass -File packaging\release.ps1 -Version 1.1.0
|
|||||||
```
|
```
|
||||||
|
|
||||||
Das Skript setzt die Versionsnummer, committet, erstellt Git-Tag `v1.1.0` und pusht zu
|
Das Skript setzt die Versionsnummer, committet, erstellt Git-Tag `v1.1.0` und pusht zu
|
||||||
`origin` (dein Repo unter https://github.com/fojadrachi/Playtube). Der gepushte Tag
|
`origin` (dein Gitea unter https://git.fojadrachi.de/Fojadrachi/Playtube). Für Playtube Edge
|
||||||
löst automatisch die GitHub-Actions-Pipeline
|
trägt der Tag den Zusatz `-edge` (z. B. `v1.0.1-edge`). Der gepushte Tag löst automatisch die
|
||||||
([.github/workflows/release.yml](.github/workflows/release.yml)) aus, die **sowohl
|
Gitea-Actions-Pipeline ([.gitea/workflows/release.yml](.gitea/workflows/release.yml)) aus, die
|
||||||
eine Windows- als auch eine Linux-Version baut** und beide als Assets an einem GitHub
|
Playtube Edge für Windows baut und als **Vorabversion** auf dem Gitea veröffentlicht -
|
||||||
Release veröffentlicht - Fortschritt unter
|
Fortschritt unter https://git.fojadrachi.de/Fojadrachi/Playtube/actions.
|
||||||
https://github.com/fojadrachi/Playtube/actions.
|
|
||||||
|
#### Releases bauen (einmalige Einrichtung)
|
||||||
|
|
||||||
|
GitHub wird nirgends mehr benutzt. Die Pipeline braucht:
|
||||||
|
|
||||||
|
1. **Einen Gitea-Actions-Runner unter Windows** (`act_runner`, Label `windows`, Host-Modus)
|
||||||
|
mit Python 3.12, git, PowerShell und [Inno Setup 6](https://jrsoftware.org/isinfo.php).
|
||||||
|
Registrierung z. B.:
|
||||||
|
`act_runner register --instance https://git.fojadrachi.de --token <Runner-Token> --labels windows:host`
|
||||||
|
2. **Ein Secret `RELEASE_TOKEN`** im Repo (Einstellungen → Actions → Secrets): ein
|
||||||
|
Zugriffstoken (Gitea → Einstellungen → Anwendungen) mit Schreibrecht auf das Repo.
|
||||||
|
3. In Gitea **Actions für das Repo aktivieren** (Einstellungen → Erweitert → Repository-Einheiten).
|
||||||
|
|
||||||
|
**Ohne Runner** kannst du selbst bauen und veröffentlichen:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File packaging\build.ps1
|
||||||
|
$env:GITEA_TOKEN = "<Zugriffstoken>"
|
||||||
|
powershell -ExecutionPolicy Bypass -File packaging\publish_release.ps1 -Tag v1.0.1-edge -Prerelease `
|
||||||
|
-Files dist\installer\PlaytubeEdge-Setup-v1.0.1.exe -NotesFile packaging\release_notes.md
|
||||||
|
```
|
||||||
|
|
||||||
Für Windows entstehen dabei drei Dateien: `Playtube-Setup-vX.Y.Z.exe` (Installer, für
|
Für Windows entstehen dabei drei Dateien: `Playtube-Setup-vX.Y.Z.exe` (Installer, für
|
||||||
Neueinsteiger und volle Updates), `Playtube-vX.Y.Z-win64.zip` (portabel) und das kleine
|
Neueinsteiger und volle Updates), `Playtube-vX.Y.Z-win64.zip` (portabel) und das kleine
|
||||||
@@ -240,9 +260,9 @@ neue Version danach automatisch angeboten.
|
|||||||
|
|
||||||
## Native Linux-Version
|
## Native Linux-Version
|
||||||
|
|
||||||
Playtube läuft genauso unter Linux (gleicher Code, gleiches PySide6/QtWebEngine) und
|
**Hinweis:** Playtube Edge nutzt WebView2 und läuft nur unter Windows. Die Linux-Beschreibung
|
||||||
wird bei jedem Release automatisch als `Playtube-vX.Y.Z-linux-x86_64.tar.gz` unter
|
unten gehört zur normalen Playtube (Branch `main`, QtWebEngine); für Edge entstehen keine
|
||||||
https://github.com/fojadrachi/Playtube/releases mitgebaut.
|
Linux-Pakete.
|
||||||
|
|
||||||
**Fertiges Release installieren** (richtet Startmenü-Eintrag + Icon ein):
|
**Fertiges Release installieren** (richtet Startmenü-Eintrag + Icon ein):
|
||||||
|
|
||||||
@@ -263,8 +283,7 @@ python3 -m venv .venv
|
|||||||
```
|
```
|
||||||
|
|
||||||
QtWebEngine benötigt unter Linux ein paar System-Bibliotheken (auf Debian/Ubuntu):
|
QtWebEngine benötigt unter Linux ein paar System-Bibliotheken (auf Debian/Ubuntu):
|
||||||
`sudo apt install libxkbcommon0 libegl1 libnss3 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libasound2t64 libatk-bridge2.0-0 libcups2` (siehe auch die vollstaendige Liste in
|
`sudo apt install libxkbcommon0 libegl1 libnss3 libxcomposite1 libxdamage1 libxrandr2 libgbm1 libasound2t64 libatk-bridge2.0-0 libcups2`.
|
||||||
[.github/workflows/release.yml](.github/workflows/release.yml)).
|
|
||||||
|
|
||||||
## Hinweise
|
## Hinweise
|
||||||
|
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ AppName={#AppName}
|
|||||||
AppVersion={#AppVersion}
|
AppVersion={#AppVersion}
|
||||||
AppVerName={#AppName} {#AppVersion}
|
AppVerName={#AppName} {#AppVersion}
|
||||||
AppPublisher=Playtube
|
AppPublisher=Playtube
|
||||||
AppPublisherURL=https://github.com/fojadrachi/Playtube
|
AppPublisherURL=https://git.fojadrachi.de/Fojadrachi/Playtube
|
||||||
AppSupportURL=https://github.com/fojadrachi/Playtube/issues
|
AppSupportURL=https://git.fojadrachi.de/Fojadrachi/Playtube/issues
|
||||||
AppUpdatesURL=https://github.com/fojadrachi/Playtube/releases
|
AppUpdatesURL=https://git.fojadrachi.de/Fojadrachi/Playtube/releases
|
||||||
VersionInfoVersion={#AppVersion}
|
VersionInfoVersion={#AppVersion}
|
||||||
DefaultDirName={localappdata}\Programs\{#AppDirName}
|
DefaultDirName={localappdata}\Programs\{#AppDirName}
|
||||||
DisableProgramGroupPage=yes
|
DisableProgramGroupPage=yes
|
||||||
|
|||||||
@@ -0,0 +1,67 @@
|
|||||||
|
# Veroeffentlicht ein Release auf dem eigenen Gitea-Server (Installer, ZIP, Patch als Anhaenge).
|
||||||
|
# Wird von der Pipeline (.gitea/workflows/release.yml) benutzt und laesst sich auch von Hand
|
||||||
|
# aufrufen, z.B. nach einem lokalen Build (packaging\build.ps1):
|
||||||
|
#
|
||||||
|
# $env:GITEA_TOKEN = "<Zugriffstoken>"
|
||||||
|
# powershell -ExecutionPolicy Bypass -File packaging\publish_release.ps1 `
|
||||||
|
# -Tag v4.6.0 -Files dist\installer\Playtube-Setup-v4.6.0.exe,Playtube-v4.6.0-win64.zip
|
||||||
|
#
|
||||||
|
# Der Token wird in Gitea unter Einstellungen > Anwendungen erzeugt (Recht "repository: Lesen und
|
||||||
|
# Schreiben"). Er steht NIE im Skript, sondern nur in der Umgebungsvariable GITEA_TOKEN.
|
||||||
|
# Gab es zum selben Tag schon ein Release, wird es vorher entfernt (der Git-Tag bleibt).
|
||||||
|
|
||||||
|
param(
|
||||||
|
[Parameter(Mandatory = $true)] [string]$Tag,
|
||||||
|
[Parameter(Mandatory = $true)] [string[]]$Files,
|
||||||
|
[string]$Title = "",
|
||||||
|
[string]$NotesFile = "",
|
||||||
|
[switch]$Prerelease,
|
||||||
|
[string]$Server = "https://git.fojadrachi.de",
|
||||||
|
[string]$Repo = "Fojadrachi/Playtube"
|
||||||
|
)
|
||||||
|
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
|
||||||
|
$token = $env:GITEA_TOKEN
|
||||||
|
if (-not $token) {
|
||||||
|
throw "GITEA_TOKEN ist nicht gesetzt (Zugriffstoken aus Gitea > Einstellungen > Anwendungen)."
|
||||||
|
}
|
||||||
|
if (-not $Title) { $Title = $Tag }
|
||||||
|
foreach ($file in $Files) {
|
||||||
|
if (-not (Test-Path $file)) { throw "Datei nicht gefunden: $file" }
|
||||||
|
}
|
||||||
|
|
||||||
|
$api = "$Server/api/v1/repos/$Repo"
|
||||||
|
$headers = @{ Authorization = "token $token" }
|
||||||
|
|
||||||
|
# Vorhandenes Release zum selben Tag entfernen (404 = gab keins).
|
||||||
|
try {
|
||||||
|
$old = Invoke-RestMethod -Headers $headers -Uri "$api/releases/tags/$Tag"
|
||||||
|
Invoke-RestMethod -Method Delete -Headers $headers -Uri "$api/releases/$($old.id)" | Out-Null
|
||||||
|
Write-Host "Vorhandenes Release zu $Tag ersetzt."
|
||||||
|
} catch {
|
||||||
|
if ($_.Exception.Response -and [int]$_.Exception.Response.StatusCode -ne 404) { throw }
|
||||||
|
}
|
||||||
|
|
||||||
|
$notes = ""
|
||||||
|
if ($NotesFile -and (Test-Path $NotesFile)) { $notes = Get-Content -Raw -Encoding UTF8 $NotesFile }
|
||||||
|
|
||||||
|
$payload = @{
|
||||||
|
tag_name = $Tag
|
||||||
|
name = $Title
|
||||||
|
body = $notes
|
||||||
|
draft = $false
|
||||||
|
prerelease = [bool]$Prerelease
|
||||||
|
} | ConvertTo-Json
|
||||||
|
$release = Invoke-RestMethod -Method Post -Headers $headers -Uri "$api/releases" `
|
||||||
|
-ContentType "application/json; charset=utf-8" -Body ([Text.Encoding]::UTF8.GetBytes($payload))
|
||||||
|
|
||||||
|
foreach ($file in $Files) {
|
||||||
|
$name = Split-Path $file -Leaf
|
||||||
|
Write-Host "Lade hoch: $name"
|
||||||
|
& curl.exe -sS --fail -X POST -H "Authorization: token $token" -F "attachment=@$file" `
|
||||||
|
"$api/releases/$($release.id)/assets?name=$([uri]::EscapeDataString($name))" | Out-Null
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw "Upload fehlgeschlagen: $name" }
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Host "Fertig: $Server/$Repo/releases/tag/$Tag" -ForegroundColor Green
|
||||||
+15
-14
@@ -1,13 +1,14 @@
|
|||||||
# Veroeffentlicht eine neue Playtube-Version: setzt die Versionsnummer, committet,
|
# Veroeffentlicht eine neue Playtube-Edge-Version: setzt die Versionsnummer, committet,
|
||||||
# taggt und pusht. Der eigentliche Build fuer Windows UND Linux sowie die
|
# taggt ("vX.Y.Z-edge") und pusht. Build und Veroeffentlichung als Vorabversion auf dem
|
||||||
# Veroeffentlichung als GitHub Release passiert danach automatisch per GitHub Actions
|
# eigenen Gitea-Server passieren danach automatisch per Gitea Actions
|
||||||
# (.github/workflows/release.yml), ausgeloest durch den gepushten Tag.
|
# (.gitea/workflows/release.yml), ausgeloest durch den gepushten Tag.
|
||||||
#
|
#
|
||||||
# Aufruf (im Projekt-Root):
|
# Aufruf (im Projekt-Root, auf dem Branch "edge"):
|
||||||
# powershell -ExecutionPolicy Bypass -File packaging\release.ps1 -Version 1.1.0
|
# powershell -ExecutionPolicy Bypass -File packaging\release.ps1 -Version 1.0.1
|
||||||
#
|
#
|
||||||
# Voraussetzung: git remote "origin" zeigt auf https://github.com/fojadrachi/Playtube
|
# Voraussetzung: git remote "origin" zeigt auf https://git.fojadrachi.de/Fojadrachi/Playtube
|
||||||
# und du bist dort push-berechtigt.
|
# und du bist dort push-berechtigt. Ohne Actions-Runner kannst du lokal bauen
|
||||||
|
# (packaging\build.ps1) und mit packaging\publish_release.ps1 -Prerelease selbst veroeffentlichen.
|
||||||
|
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory = $true)]
|
[Parameter(Mandatory = $true)]
|
||||||
@@ -19,9 +20,9 @@ $root = Split-Path -Parent $PSScriptRoot
|
|||||||
Set-Location $root
|
Set-Location $root
|
||||||
|
|
||||||
if ($Version -notmatch '^\d+\.\d+\.\d+$') {
|
if ($Version -notmatch '^\d+\.\d+\.\d+$') {
|
||||||
throw "Version muss im Format X.Y.Z angegeben werden, z.B. 1.1.0"
|
throw "Version muss im Format X.Y.Z angegeben werden, z.B. 1.0.1"
|
||||||
}
|
}
|
||||||
$tag = "v$Version"
|
$tag = "v$Version-edge"
|
||||||
|
|
||||||
Write-Host "==> Setze Version auf $Version in playtube/__init__.py" -ForegroundColor Cyan
|
Write-Host "==> Setze Version auf $Version in playtube/__init__.py" -ForegroundColor Cyan
|
||||||
$initFile = Join-Path $root "playtube\__init__.py"
|
$initFile = Join-Path $root "playtube\__init__.py"
|
||||||
@@ -30,13 +31,13 @@ $initFile = Join-Path $root "playtube\__init__.py"
|
|||||||
Write-Host "==> Commit + Tag $tag ..." -ForegroundColor Cyan
|
Write-Host "==> Commit + Tag $tag ..." -ForegroundColor Cyan
|
||||||
git add -A
|
git add -A
|
||||||
git commit -m "Release $tag" --allow-empty
|
git commit -m "Release $tag" --allow-empty
|
||||||
git tag -a $tag -m "Playtube $tag"
|
git tag -a $tag -m "Playtube Edge $tag"
|
||||||
|
|
||||||
Write-Host "==> Push zu origin ..." -ForegroundColor Cyan
|
Write-Host "==> Push zu origin ..." -ForegroundColor Cyan
|
||||||
git push origin HEAD
|
git push origin HEAD
|
||||||
git push origin $tag
|
git push origin $tag
|
||||||
|
|
||||||
Write-Host ""
|
Write-Host ""
|
||||||
Write-Host "Fertig. GitHub Actions baut jetzt Windows- und Linux-Pakete und" -ForegroundColor Green
|
Write-Host "Fertig. Gitea Actions baut jetzt Playtube Edge und" -ForegroundColor Green
|
||||||
Write-Host "veroeffentlicht sie als Release $tag - Fortschritt unter:" -ForegroundColor Green
|
Write-Host "veroeffentlicht es als Release $tag - Fortschritt unter:" -ForegroundColor Green
|
||||||
Write-Host "https://github.com/fojadrachi/Playtube/actions" -ForegroundColor Green
|
Write-Host "https://git.fojadrachi.de/Fojadrachi/Playtube/actions" -ForegroundColor Green
|
||||||
|
|||||||
@@ -392,7 +392,7 @@ class MainWindow(QMainWindow):
|
|||||||
def _on_update_check_failed(self) -> None:
|
def _on_update_check_failed(self) -> None:
|
||||||
self._settings_tab.set_check_done()
|
self._settings_tab.set_check_done()
|
||||||
self._settings_tab.set_update_status(
|
self._settings_tab.set_update_status(
|
||||||
"Update-Prüfung fehlgeschlagen (keine Internetverbindung oder GitHub nicht erreichbar)."
|
"Update-Prüfung fehlgeschlagen (keine Internetverbindung oder Update-Server nicht erreichbar)."
|
||||||
)
|
)
|
||||||
|
|
||||||
def _on_update_available(self, version: str, notes: str, download_url: str) -> None:
|
def _on_update_available(self, version: str, notes: str, download_url: str) -> None:
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ from PySide6.QtWidgets import (
|
|||||||
from . import __version__ as APP_VERSION
|
from . import __version__ as APP_VERSION
|
||||||
from .audio_routing import SYSTEM_DEFAULT_LABEL, list_output_devices
|
from .audio_routing import SYSTEM_DEFAULT_LABEL, list_output_devices
|
||||||
from .config import APP_NAME, save_config
|
from .config import APP_NAME, save_config
|
||||||
from .updater import GITHUB_REPO
|
from .updater import REPO_URL
|
||||||
|
|
||||||
# Helle Schrift fuer Versionsnummer, Update-Status und GitHub-Link. palette(text) ist die
|
# Helle Schrift fuer Versionsnummer, Update-Status und GitHub-Link. palette(text) ist die
|
||||||
# Standard-Textfarbe (im dunklen Design weiss, im hellen dunkel) - das fruehere
|
# Standard-Textfarbe (im dunklen Design weiss, im hellen dunkel) - das fruehere
|
||||||
@@ -180,7 +180,7 @@ class SettingsTab(QWidget):
|
|||||||
button_row.addStretch(1)
|
button_row.addStretch(1)
|
||||||
outer.addLayout(button_row)
|
outer.addLayout(button_row)
|
||||||
|
|
||||||
info = QLabel(f"github.com/{GITHUB_REPO}")
|
info = QLabel(REPO_URL.removeprefix("https://"))
|
||||||
info.setStyleSheet(_LIGHT_TEXT_STYLE)
|
info.setStyleSheet(_LIGHT_TEXT_STYLE)
|
||||||
outer.addWidget(info)
|
outer.addWidget(info)
|
||||||
|
|
||||||
|
|||||||
+9
-7
@@ -1,7 +1,7 @@
|
|||||||
"""Auto-Update ueber GitHub Releases (https://github.com/fojadrachi/Playtube).
|
"""Auto-Update ueber die Releases des eigenen Gitea-Servers (siehe UPDATE_SERVER).
|
||||||
|
|
||||||
Ablauf:
|
Ablauf:
|
||||||
1. UpdateChecker prueft im Hintergrund die GitHub-Releases-API auf eine neuere
|
1. UpdateChecker prueft im Hintergrund die Gitea-Releases-API auf eine neuere
|
||||||
Version als die aktuell laufende (playtube.__version__).
|
Version als die aktuell laufende (playtube.__version__).
|
||||||
2. Bei Fund fragt die UI (siehe mainwindow.py) nach Bestaetigung.
|
2. Bei Fund fragt die UI (siehe mainwindow.py) nach Bestaetigung.
|
||||||
3. UpdateInstaller installiert das Update:
|
3. UpdateInstaller installiert das Update:
|
||||||
@@ -53,10 +53,14 @@ from PySide6.QtCore import QThread, Signal
|
|||||||
|
|
||||||
from . import __version__ as CURRENT_VERSION
|
from . import __version__ as CURRENT_VERSION
|
||||||
|
|
||||||
GITHUB_REPO = "fojadrachi/Playtube"
|
# Eigener Gitea-Server (kein GitHub). Die Releases dort werden von .gitea/workflows/release.yml
|
||||||
|
# bzw. packaging/publish_release.ps1 veroeffentlicht.
|
||||||
|
UPDATE_SERVER = "https://git.fojadrachi.de"
|
||||||
|
REPO_SLUG = "Fojadrachi/Playtube"
|
||||||
|
REPO_URL = f"{UPDATE_SERVER}/{REPO_SLUG}"
|
||||||
# Edge-Variante: eigene Releases mit Tag "vX.Y.Z-edge" (als Vorabversion markiert, damit die
|
# Edge-Variante: eigene Releases mit Tag "vX.Y.Z-edge" (als Vorabversion markiert, damit die
|
||||||
# Qt-Version sie nie als "neueste Version" sieht) - deshalb die Liste statt /releases/latest.
|
# Qt-Version sie nie als "neueste Version" sieht) - deshalb die Liste statt /releases/latest.
|
||||||
_API_URL = f"https://api.github.com/repos/{GITHUB_REPO}/releases?per_page=30"
|
_API_URL = f"{UPDATE_SERVER}/api/v1/repos/{REPO_SLUG}/releases?limit=30"
|
||||||
_EDGE_TAG_SUFFIX = "-edge"
|
_EDGE_TAG_SUFFIX = "-edge"
|
||||||
_USER_AGENT = "PlaytubeEdge-Updater"
|
_USER_AGENT = "PlaytubeEdge-Updater"
|
||||||
|
|
||||||
@@ -103,9 +107,7 @@ def cleanup_old_staging() -> None:
|
|||||||
|
|
||||||
|
|
||||||
def fetch_latest_release() -> dict[str, Any] | None:
|
def fetch_latest_release() -> dict[str, Any] | None:
|
||||||
req = urllib.request.Request(
|
req = urllib.request.Request(_API_URL, headers={"User-Agent": _USER_AGENT, "Accept": "application/json"})
|
||||||
_API_URL, headers={"User-Agent": _USER_AGENT, "Accept": "application/vnd.github+json"}
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
with urllib.request.urlopen(req, timeout=10) as resp:
|
with urllib.request.urlopen(req, timeout=10) as resp:
|
||||||
releases = json.loads(resp.read().decode("utf-8"))
|
releases = json.loads(resp.read().decode("utf-8"))
|
||||||
|
|||||||
Reference in New Issue
Block a user