From 2646c5f084df6e51dcd9f6097a9c25f75abfff00 Mon Sep 17 00:00:00 2001 From: wlkns-dev Date: Sat, 7 Nov 2026 12:06:20 +0100 Subject: [PATCH] =?UTF-8?q?CI:=20Release-Workflow=20(Tag=20v*=20=E2=86=92?= =?UTF-8?q?=20AppImage+deb=20auf=20ubuntu-latest,=20pacman=20auf=20arch/ba?= =?UTF-8?q?se-devel),=20PKGBUILD,=20.desktop,=20LICENSE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/release.yml | 100 ++++++++++++++++++++++++++++++++ LICENSE | 21 +++++++ packaging/arch/PKGBUILD | 31 ++++++++++ packaging/arch/hoerwerk.desktop | 10 ++++ src-tauri/tauri.conf.json | 2 +- 5 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 .gitea/workflows/release.yml create mode 100644 LICENSE create mode 100644 packaging/arch/PKGBUILD create mode 100644 packaging/arch/hoerwerk.desktop diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..5060e18 --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,100 @@ +name: Release (AppImage + deb + pacman) +on: + push: + tags: + - 'v*' + +jobs: + build-deb-appimage: + name: AppImage + deb (Ubuntu) + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: System-Abhängigkeiten + run: | + sudo apt-get update -q + sudo apt-get install -y --no-install-recommends \ + libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev \ + librsvg2-dev patchelf file + + - name: Bauen (AppImage + deb) + run: | + node -v + npm install + npm run tauri build -- --bundles appimage,deb + + - name: Release anlegen/ermitteln + run: | + VER=${GITHUB_REF_NAME} + API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk" + curl -sf -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER\",\"draft\":false,\"prerelease\":false}" \ + "$API/releases" > /tmp/rel.json || true + RID=$(cat /tmp/rel.json | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' 2>/dev/null || echo) + if [ -z "$RID" ]; then + curl -sf -H "Authorization: token $GITHUB_TOKEN" "$API/releases/tags/$VER" > /tmp/rel.json + RID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])') + fi + echo "RELEASE_ID=$RID" >> "$GITHUB_ENV" + + - name: Anhängen (deb + AppImage) + env: + RELEASE_ID: ${{ env.RELEASE_ID }} + run: | + API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk" + for f in src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/deb/*.deb; do + echo "Lade $(basename "$f") hoch…" + curl -sf -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -F "attachment=@$f" \ + "$API/releases/$RELEASE_ID/assets?name=$(basename "$f")" + done + + build-pacman: + name: pacman (Arch) + runs-on: arch-base-devel + steps: + - name: Base aktualisieren + run: pacman -Syu --noconfirm --needed nodejs npm + + - name: Checkout + uses: actions/checkout@v4 + + - name: pacman-Paket bauen + run: | + cd packaging/arch + sudo useradd -m builder || true + chown -R builder:builder . + sudo -u builder makepkg -sf --noconfirm + + - name: Release anlegen/ermitteln + run: | + VER=${GITHUB_REF_NAME} + API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk" + curl -sf -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -H 'Content-Type: application/json' \ + -d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER\",\"draft\":false,\"prerelease\":false}" \ + "$API/releases" > /tmp/rel2.json || true + RID=$(cat /tmp/rel2.json | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' 2>/dev/null || echo) + if [ -z "$RID" ]; then + curl -sf -H "Authorization: token $GITHUB_TOKEN" "$API/releases/tags/$VER" > /tmp/rel2.json + RID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])') + fi + echo "RELEASE_ID=$RID" >> "$GITHUB_ENV" + + - name: Anhängen (pacman) + env: + RELEASE_ID: ${{ env.RELEASE_ID }} + run: | + API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk" + f=$(find . -name "hoerwerk-*.pkg.tar.zst" -type f | head -1) + echo "Lade $(basename "$f") hoch…" + curl -sf -X POST \ + -H "Authorization: token $GITHUB_TOKEN" \ + -F "attachment=@$f" \ + "$API/releases/$RELEASE_ID/assets?name=$(basename "$f")" diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..c539728 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Stephan Wilkens + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD new file mode 100644 index 0000000..2879a7c --- /dev/null +++ b/packaging/arch/PKGBUILD @@ -0,0 +1,31 @@ +# Maintainer: Stephan Wilkens +pkgname=hoerwerk +pkgver=0.1.0 +pkgrel=1 +pkgdesc='Lokaler Hörbuch-Player für die eigene Audible-Bibliothek (Tauri 2 + Svelte)' +arch=('x86_64') +url='https://git.wlkns.org/wlkns-dev/hoerwerk' +license=('MIT') +depends=('gtk3' 'webkit2gtk-4.1' 'libayatana-appindicator' 'mpv' 'ffmpeg' 'openssl') +makedepends=('git' 'nodejs' 'npm' 'rust') +source=("git+https://git.wlkns.org/wlkns-dev/hoerwerk.git#tag=v$pkgver") +sha256sums=('SKIP') + +build() { + cd "$srcdir/hoerwerk" + npm install + npm run build + cd src-tauri + cargo build --release +} + +package() { + cd "$srcdir/hoerwerk" + install -Dm755 src-tauri/target/release/hoerwerk "$pkgdir/usr/bin/hoerwerk" + install -Dm644 src-tauri/icons/128x128.png "$pkgdir/usr/share/icons/hicolor/128x128/apps/hoerwerk.png" + install -Dm644 src-tauri/icons/32x32.png "$pkgdir/usr/share/icons/hicolor/32x32/apps/hoerwerk.png" + install -Dm644 src-tauri/icons/icon.png "$pkgdir/usr/share/icons/hicolor/512x512/apps/hoerwerk.png" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/hoerwerk/LICENSE" + install -Dm644 packaging/arch/hoerwerk.desktop "$pkgdir/usr/share/applications/hoerwerk.desktop" + install -d "$pkgdir/usr/share/hoerwerk" +} diff --git a/packaging/arch/hoerwerk.desktop b/packaging/arch/hoerwerk.desktop new file mode 100644 index 0000000..4f04a2d --- /dev/null +++ b/packaging/arch/hoerwerk.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Hörwerk +GenericName=Hörbuch-Player +Comment=Lokaler Audible-Hörbuch-Player +Exec=hoerwerk +Icon=hoerwerk +Type=Application +Categories=AudioVideo;Audio;Player; +Keywords=hoerbuch;audible;player; +StartupWMClass=hoerwerk diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index c53b953..0877e4c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -27,7 +27,7 @@ }, "bundle": { "active": true, - "targets": "all", + "targets": ["appimage", "deb"], "icon": [ "icons/32x32.png", "icons/128x128.png",