wip: Sicherungs-Commit aller Änderungen seit April + Arbeitsstruktur (CLAUDE.md, ROADMAP.md, PROGRESS.md, Autopilot)
6 Wochen uncommittete Arbeit (Voice-Channels, LiveKit-Manager, Settings-Modal u.v.m.) als ein WIP-Commit gesichert, damit nichts verloren geht und der Pi den aktuellen Stand klonen kann. Thematische Aufarbeitung: siehe ROADMAP M0. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CPrAGBxBT6GfPXzeWQ4AXb
This commit is contained in:
+103
-20
@@ -5,16 +5,58 @@
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
# Always run from the project root, regardless of where the script was called from.
|
||||
Set-Location (Split-Path $PSScriptRoot -Parent)
|
||||
|
||||
# ── Config ────────────────────────────────────────────────────────────────────
|
||||
$GiteaBase = "https://git.steggi-matrix.work"
|
||||
$GiteaBase = "http://192.168.178.71:3000"
|
||||
$GiteaRepo = "steggi/pyramid"
|
||||
$GiteaToken = "bb522f9646c6856c9ab58bef0151ac36a9ce1d57"
|
||||
$Headers = @{ Authorization = "token $GiteaToken"; "Content-Type" = "application/json" }
|
||||
|
||||
# ── Read version from pubspec.yaml ────────────────────────────────────────────
|
||||
$pubspec = Get-Content "pubspec.yaml" | Where-Object { $_ -match "^version:" }
|
||||
if (-not $pubspec) { Write-Error "version not found in pubspec.yaml"; exit 1 }
|
||||
$version = ($pubspec -split ":")[1].Trim().Split("+")[0]
|
||||
# ── Read and Update version from pubspec.yaml ─────────────────────────────────
|
||||
$pubspecPath = "pubspec.yaml"
|
||||
$pubspecLines = @(Get-Content $pubspecPath)
|
||||
$versionIndex = -1
|
||||
for ($i = 0; $i -lt $pubspecLines.Count; $i++) {
|
||||
if ($pubspecLines[$i] -match "^version:") {
|
||||
$versionIndex = $i
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($versionIndex -lt 0) { Write-Error "version not found in pubspec.yaml"; exit 1 }
|
||||
|
||||
$currentVersionFull = ($pubspecLines[$versionIndex] -split ":")[1].Trim()
|
||||
$currentVersion = $currentVersionFull.Split("+")[0]
|
||||
$currentBuild = 0
|
||||
if ($currentVersionFull -match "\+") {
|
||||
$currentBuild = [int]$currentVersionFull.Split("+")[1]
|
||||
}
|
||||
|
||||
$vParts = $currentVersion.Split(".")
|
||||
$major = [int]$vParts[0]
|
||||
$minor = [int]$vParts[1]
|
||||
$patch = [int]$vParts[2]
|
||||
$nextPatch = "$major.$minor.$($patch + 1)"
|
||||
$nextBuild = $currentBuild + 1
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " Aktuelle Version : $currentVersion (Build $currentBuild)" -ForegroundColor Cyan
|
||||
$newVersionInput = Read-Host " Neue Version eingeben (Leer lassen für $nextPatch)"
|
||||
if ([string]::IsNullOrWhiteSpace($newVersionInput)) {
|
||||
$newVersion = $nextPatch
|
||||
} else {
|
||||
$newVersion = $newVersionInput.Trim().TrimStart("v")
|
||||
}
|
||||
|
||||
$newVersionFull = "$newVersion+$nextBuild"
|
||||
if ($newVersionFull -ne $currentVersionFull) {
|
||||
$pubspecLines[$versionIndex] = "version: $newVersionFull"
|
||||
Set-Content -Path $pubspecPath -Value $pubspecLines
|
||||
Write-Host " pubspec.yaml auf $newVersionFull aktualisiert." -ForegroundColor Green
|
||||
}
|
||||
|
||||
$version = $newVersion
|
||||
$tag = "v$version"
|
||||
|
||||
Write-Host ""
|
||||
@@ -41,8 +83,11 @@ try {
|
||||
Write-Host " Release-Notizen (leer lassen = Changelog aus Git-Commits):" -ForegroundColor Cyan
|
||||
$notes = Read-Host " > "
|
||||
if ([string]::IsNullOrWhiteSpace($notes)) {
|
||||
# Auto-generate from git log since last tag
|
||||
$lastTag = git describe --tags --abbrev=0 HEAD^ 2>$null
|
||||
# Auto-generate from git log since last tag.
|
||||
# git describe exits non-zero when no tags exist; catch the error explicitly
|
||||
# because $ErrorActionPreference = "Stop" would otherwise abort the script.
|
||||
$lastTag = $null
|
||||
try { $lastTag = git describe --tags --abbrev=0 HEAD^ 2>$null } catch {}
|
||||
if ($lastTag) {
|
||||
$notes = git log "$lastTag..HEAD" --pretty=format:"- %s" 2>$null | Out-String
|
||||
} else {
|
||||
@@ -65,21 +110,51 @@ Write-Host " Windows ZIP: $winZip" -ForegroundColor Green
|
||||
|
||||
# ── Build Android ─────────────────────────────────────────────────────────────
|
||||
Write-Host ""
|
||||
Write-Host " [2/4] Android Build..." -ForegroundColor Cyan
|
||||
flutter build apk --release
|
||||
Write-Host " [2/4] Android Build (split per ABI)..." -ForegroundColor Cyan
|
||||
flutter build apk --release --split-per-abi
|
||||
if ($LASTEXITCODE -ne 0) { Write-Error "Android build fehlgeschlagen"; exit 1 }
|
||||
|
||||
$apkSrc = "build\app\outputs\flutter-apk\app-release.apk"
|
||||
$apkDst = "build\pyramid-android-$tag.apk"
|
||||
Copy-Item $apkSrc $apkDst -Force
|
||||
Write-Host " Android APK: $apkDst" -ForegroundColor Green
|
||||
# Order matters: arm64-v8a is uploaded first so app versions that still pick
|
||||
# the first APK asset (pre-ABI-aware updater) get the variant that fits
|
||||
# practically every real device.
|
||||
$abiBuilds = @(
|
||||
@{ Abi = "arm64-v8a"; Desc = "64-bit ARM — praktisch jedes Smartphone der letzten ~8 Jahre. Im Zweifel diese Datei." },
|
||||
@{ Abi = "armeabi-v7a"; Desc = "32-bit ARM — sehr alte Geräte" },
|
||||
@{ Abi = "x86_64"; Desc = "Emulatoren / x86-Geräte" }
|
||||
)
|
||||
$apkFiles = @()
|
||||
foreach ($b in $abiBuilds) {
|
||||
$abi = $b.Abi
|
||||
$src = "build\app\outputs\flutter-apk\app-$abi-release.apk"
|
||||
if (-not (Test-Path $src)) { Write-Error "APK fehlt: $src"; exit 1 }
|
||||
$dst = "build\pyramid-android-$abi-$tag.apk"
|
||||
Copy-Item $src $dst -Force
|
||||
$apkFiles += @{ Path = $dst; Name = "pyramid-android-$abi-$tag.apk"; Desc = $b.Desc }
|
||||
$sizeMb = [math]::Round((Get-Item $dst).Length / 1MB, 1)
|
||||
Write-Host " Android APK ($abi, $sizeMb MB): $dst" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# Append a download guide to the release notes so every asset is explained.
|
||||
$downloadGuide = "`n`n## Downloads`n`n| Datei | Für welches Gerät? |`n|---|---|`n"
|
||||
foreach ($f in $apkFiles) {
|
||||
$downloadGuide += "| ``$($f.Name)`` | $($f.Desc) |`n"
|
||||
}
|
||||
$downloadGuide += "| ``pyramid-windows-$tag.zip`` | Windows 10/11 |`n"
|
||||
$downloadGuide += "`n*Die App lädt beim automatischen Update selbst die passende Variante.*"
|
||||
$notes = $notes.Trim() + $downloadGuide
|
||||
|
||||
# ── Git tag ───────────────────────────────────────────────────────────────────
|
||||
Write-Host ""
|
||||
Write-Host " [3/4] Git Tag $tag..." -ForegroundColor Cyan
|
||||
git tag -f $tag
|
||||
git push origin $tag --force
|
||||
Write-Host " Tag gepusht." -ForegroundColor Green
|
||||
# Token in die Push-URL einbetten, damit keine interaktive Passwort-Abfrage nötig ist
|
||||
$pushUrl = $GiteaBase -replace "http://", "http://steggi:$GiteaToken@"
|
||||
& git push "$pushUrl/steggi/pyramid.git" $tag --force
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Host " [!] Tag-Push fehlgeschlagen (Release wird trotzdem erstellt)." -ForegroundColor Yellow
|
||||
} else {
|
||||
Write-Host " Tag gepusht." -ForegroundColor Green
|
||||
}
|
||||
|
||||
# ── Create Gitea release ──────────────────────────────────────────────────────
|
||||
Write-Host ""
|
||||
@@ -101,15 +176,23 @@ Write-Host " Release ID: $releaseId" -ForegroundColor Gray
|
||||
|
||||
# ── Upload artifacts ──────────────────────────────────────────────────────────
|
||||
function Upload-Asset($filePath, $fileName) {
|
||||
$uploadHeaders = @{ Authorization = "token $GiteaToken" }
|
||||
$form = @{ attachment = Get-Item $filePath }
|
||||
$uri = "$GiteaBase/api/v1/repos/$GiteaRepo/releases/$releaseId/assets?name=$fileName"
|
||||
Invoke-RestMethod $uri -Headers $uploadHeaders -Method Post -Form $form | Out-Null
|
||||
# curl.exe (built into Windows 10+) handles large binary uploads reliably.
|
||||
$uri = "$GiteaBase/api/v1/repos/$GiteaRepo/releases/$releaseId/assets?name=$fileName"
|
||||
$result = & curl.exe -s --fail -w "%{http_code}" `
|
||||
-X POST $uri `
|
||||
-H "Authorization: token $GiteaToken" `
|
||||
-F "attachment=@`"$filePath`""
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "Upload fehlgeschlagen ($result): $fileName"
|
||||
}
|
||||
Write-Host " Hochgeladen: $fileName" -ForegroundColor Green
|
||||
}
|
||||
|
||||
# APKs first (arm64-v8a leads — see comment at $abiBuilds), then Windows.
|
||||
foreach ($f in $apkFiles) {
|
||||
Upload-Asset $f.Path $f.Name
|
||||
}
|
||||
Upload-Asset $winZip "pyramid-windows-$tag.zip"
|
||||
Upload-Asset $apkDst "pyramid-android-$tag.apk"
|
||||
|
||||
# ── Done ──────────────────────────────────────────────────────────────────────
|
||||
Write-Host ""
|
||||
|
||||
Reference in New Issue
Block a user