Update-Quelle ist jetzt der eigene Gitea-Server, Release-Pipeline unter .gitea/workflows, Veroeffentlichen per packaging/publish_release.ps1.
44 lines
1.7 KiB
PowerShell
44 lines
1.7 KiB
PowerShell
# Veroeffentlicht eine neue Playtube-Version: setzt die Versionsnummer, committet,
|
|
# taggt und pusht. Der eigentliche Build und die Veroeffentlichung als Release auf dem
|
|
# eigenen Gitea-Server passiert danach automatisch per Gitea Actions
|
|
# (.gitea/workflows/release.yml), ausgeloest durch den gepushten Tag.
|
|
#
|
|
# Aufruf (im Projekt-Root):
|
|
# powershell -ExecutionPolicy Bypass -File packaging\release.ps1 -Version 1.1.0
|
|
#
|
|
# Voraussetzung: git remote "origin" zeigt auf https://git.fojadrachi.de/Fojadrachi/Playtube
|
|
# und du bist dort push-berechtigt. Ohne Actions-Runner kannst du lokal bauen
|
|
# (packaging\build.ps1) und mit packaging\publish_release.ps1 selbst veroeffentlichen.
|
|
|
|
param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$Version
|
|
)
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
Set-Location $root
|
|
|
|
if ($Version -notmatch '^\d+\.\d+\.\d+$') {
|
|
throw "Version muss im Format X.Y.Z angegeben werden, z.B. 1.1.0"
|
|
}
|
|
$tag = "v$Version"
|
|
|
|
Write-Host "==> Setze Version auf $Version in playtube/__init__.py" -ForegroundColor Cyan
|
|
$initFile = Join-Path $root "playtube\__init__.py"
|
|
(Get-Content $initFile) -replace '__version__ = ".*"', "__version__ = `"$Version`"" | Set-Content $initFile -Encoding utf8
|
|
|
|
Write-Host "==> Commit + Tag $tag ..." -ForegroundColor Cyan
|
|
git add -A
|
|
git commit -m "Release $tag" --allow-empty
|
|
git tag -a $tag -m "Playtube $tag"
|
|
|
|
Write-Host "==> Push zu origin ..." -ForegroundColor Cyan
|
|
git push origin HEAD
|
|
git push origin $tag
|
|
|
|
Write-Host ""
|
|
Write-Host "Fertig. Gitea Actions baut jetzt das Windows-Paket und" -ForegroundColor Green
|
|
Write-Host "veroeffentlicht es als Release $tag - Fortschritt unter:" -ForegroundColor Green
|
|
Write-Host "https://git.fojadrachi.de/Fojadrachi/Playtube/actions" -ForegroundColor Green
|