Initial Tdarr-tray: KDE systray applet for the Tdarr workstation node
All checks were successful
release / release (push) Successful in 16s

PyQt6 QSystemTrayIcon: green=running, red=stopped, yellow=transition.
Pause/resume the node via the API (frees/reclaims the GPU, no sudo) so you
can free the 4060 Ti before gaming. Playbook standard: README (per-OS
prereqs + build/run/test), doc/plan.md, .gitignore (build/ first), VS Code
build task -> ./build, install.sh + one-line curl (clone or release),
Gitea Actions rolling-latest release.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011YPrEZVBpPVoCRyJz2exkZ
This commit is contained in:
2026-07-05 20:34:35 +02:00
commit 81ff5c7fea
7 changed files with 430 additions and 0 deletions

View File

@@ -0,0 +1,65 @@
name: release
# Publicerar tray-appen (tdarr-tray.py) + install.sh till en rullande
# 'latest'-release; en vX.Y.Z-tag ger en versionerad release. Runnern använder
# sin egen GITHUB_TOKEN mot Gitea-API:t.
on:
push:
branches: [master, main]
tags: ["v*"]
workflow_dispatch:
inputs:
tag:
description: "Release-tag (tom = 'latest')"
required: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Bestäm tag
id: t
run: |
case "$GITHUB_REF" in
refs/tags/*) T="$GITHUB_REF_NAME" ;;
*) T="${{ inputs.tag }}"; [ -z "$T" ] && T="latest" ;;
esac
echo "tag=$T" >> "$GITHUB_OUTPUT"
- name: Paketera + syntaxkoll
run: |
set -eux
SUDO=""; [ "$(id -u)" -ne 0 ] && SUDO=sudo
$SUDO apt-get update && $SUDO apt-get install -y --no-install-recommends jq curl ca-certificates python3 || true
python3 -m py_compile tdarr-tray.py
mkdir -p dist
cp tdarr-tray.py dist/tdarr-tray.py
cp install.sh dist/install.sh
cd dist && sha256sum tdarr-tray.py install.sh > checksums.txt && ls -la
- name: Skapa release + ladda upp assets
env:
API: http://gitea-d:3000/api/v1
REPO: ${{ github.repository }}
TAG: ${{ steps.t.outputs.tag }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -eu
BODY="Tdarr-tray $TAG — systray-applet för Tdarr-noden (KDE/Plasma).
Installera (en rad):
curl -fsSL https://gitea.brasse-pc.eu/brasse/Tdarr-tray/raw/branch/master/install.sh | sh
Kräver python3 + PyQt6. Se wiki."
payload=$(jq -n --arg tag "$TAG" --arg body "$BODY" '{tag_name:$tag,name:$tag,body:$body}')
rid=$(curl -s -X POST "$API/repos/$REPO/releases" -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' -d "$payload" | jq -r '.id // empty')
[ -z "$rid" ] && rid=$(curl -s "$API/repos/$REPO/releases/tags/$TAG" -H "Authorization: token $TOKEN" | jq -r '.id')
curl -s -X PATCH "$API/repos/$REPO/releases/$rid" -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
-d "$(jq -n --arg tag "$TAG" --arg body "$BODY" '{name:$tag,body:$body}')" -o /dev/null
for f in tdarr-tray.py install.sh checksums.txt; do
aid=$(curl -s "$API/repos/$REPO/releases/$rid/assets" -H "Authorization: token $TOKEN" | jq -r ".[] | select(.name==\"$f\") | .id")
[ -n "$aid" ] && [ "$aid" != "null" ] && curl -s -X DELETE "$API/repos/$REPO/releases/$rid/assets/$aid" -H "Authorization: token $TOKEN" -o /dev/null
curl -s -X POST "$API/repos/$REPO/releases/$rid/assets?name=$f" -H "Authorization: token $TOKEN" -F "attachment=@dist/$f" -o /dev/null -w " $f -> HTTP %{http_code}\n"
done