Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5eb6afe916 | |||
| 86ddae642f | |||
| 2f7b4f5ced | |||
| b1b33bf3e8 | |||
| 187ce10310 | |||
| 561e192dc2 |
@ -8,6 +8,9 @@ jobs:
|
|||||||
build-deb-appimage:
|
build-deb-appimage:
|
||||||
name: AppImage + deb (Ubuntu)
|
name: AppImage + deb (Ubuntu)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
env:
|
||||||
|
HW_TOKEN: ${{ secrets.HW_RELEASE_TOKEN }}
|
||||||
|
HW_API: https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@ -32,43 +35,59 @@ jobs:
|
|||||||
npm install
|
npm install
|
||||||
npm run tauri build -- --bundles appimage,deb
|
npm run tauri build -- --bundles appimage,deb
|
||||||
|
|
||||||
- name: Release anlegen/ermitteln
|
- name: Release anhängen (deb + AppImage)
|
||||||
run: |
|
run: |
|
||||||
VER=${GITHUB_REF_NAME}
|
VER="$GITHUB_REF_NAME"
|
||||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
set -u
|
||||||
curl -sf -X POST \
|
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
post_release() {
|
||||||
-H 'Content-Type: application/json' \
|
curl -sS -X POST \
|
||||||
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER\",\"draft\":false,\"prerelease\":false}" \
|
-H "Authorization: token $HW_TOKEN" \
|
||||||
"$API/releases" > /tmp/rel.json || true
|
-H 'Content-Type: application/json' \
|
||||||
RID=$(cat /tmp/rel.json | python3 -c 'import json,sys; print(json.load(sys.stdin).get("id",""))' 2>/dev/null || echo)
|
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER — AppImage, deb und Arch-Paket.\",\"draft\":false,\"prerelease\":false}" \
|
||||||
if [ -z "$RID" ]; then
|
-w '\n%{http_code}' \
|
||||||
curl -sf -H "Authorization: token $GITHUB_TOKEN" "$API/releases/tags/$VER" > /tmp/rel.json
|
-o /tmp/hw-rel-body.json \
|
||||||
RID=$(python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')
|
"$HW_API/releases"
|
||||||
fi
|
}
|
||||||
echo "RELEASE_ID=$RID" >> "$GITHUB_ENV"
|
get_release() {
|
||||||
|
curl -sS -H "Authorization: token $HW_TOKEN" \
|
||||||
|
-w '\n%{http_code}' -o /tmp/hw-rel-body.json \
|
||||||
|
"$HW_API/releases/tags/$VER"
|
||||||
|
}
|
||||||
|
|
||||||
|
code=$(post_release | tail -n1)
|
||||||
|
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body.json | head -n1 | grep -o '[0-9]*')
|
||||||
|
if [ -z "$RID" ] && [ "$code" != "201" ]; then
|
||||||
|
get_release >/dev/null
|
||||||
|
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body.json | head -n1 | grep -o '[0-9]*')
|
||||||
|
fi
|
||||||
|
if [ -z "$RID" ]; then
|
||||||
|
echo "Release-ID konnte nicht ermittelt werden (code=$code)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Release-ID: $RID"
|
||||||
|
|
||||||
- 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
|
for f in src-tauri/target/release/bundle/appimage/*.AppImage src-tauri/target/release/bundle/deb/*.deb; do
|
||||||
echo "Lade $(basename "$f") hoch…"
|
echo "Lade $(basename "$f") hoch…"
|
||||||
curl -sf -X POST \
|
c=$(curl -sS -X POST -H "Authorization: token $HW_TOKEN" \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
|
||||||
-F "attachment=@$f" \
|
-F "attachment=@$f" \
|
||||||
"$API/releases/$RELEASE_ID/assets?name=$(basename "$f")"
|
-o /tmp/hw-upload.json -w '%{http_code}' \
|
||||||
|
"$HW_API/releases/$RID/assets?name=$(basename "$f")")
|
||||||
|
echo " Upload-Code: $c"
|
||||||
|
case "$c" in 200|201) echo " ok";; *) cat /tmp/hw-upload.json; exit 1;; esac
|
||||||
done
|
done
|
||||||
|
|
||||||
build-pacman:
|
build-pacman:
|
||||||
name: pacman (Arch)
|
name: pacman (Arch)
|
||||||
runs-on: arch-base-devel
|
runs-on: arch-base-devel
|
||||||
|
env:
|
||||||
|
HW_TOKEN: ${{ secrets.HW_RELEASE_TOKEN }}
|
||||||
|
HW_API: https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk
|
||||||
steps:
|
steps:
|
||||||
- name: Abhängigkeiten (root)
|
- name: Abhängigkeiten (root)
|
||||||
run: |
|
run: |
|
||||||
pacman -Syu --noconfirm --needed \
|
pacman -Syu --noconfirm --needed \
|
||||||
base-devel git nodejs npm rust gtk3 webkit2gtk-4.1 \
|
base-devel git nodejs npm rust python gtk3 webkit2gtk-4.1 \
|
||||||
libayatana-appindicator mpv ffmpeg
|
libayatana-appindicator mpv ffmpeg
|
||||||
|
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -81,30 +100,44 @@ jobs:
|
|||||||
chown -R builder:builder ..
|
chown -R builder:builder ..
|
||||||
sudo -u builder env HOME=/home/builder makepkg -f --noconfirm
|
sudo -u builder env HOME=/home/builder makepkg -f --noconfirm
|
||||||
|
|
||||||
- name: Release anlegen/ermitteln
|
- name: Release anhängen (pacman)
|
||||||
run: |
|
run: |
|
||||||
VER=${GITHUB_REF_NAME}
|
VER="$GITHUB_REF_NAME"
|
||||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
set -u
|
||||||
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)
|
post_release() {
|
||||||
env:
|
curl -sS -X POST \
|
||||||
RELEASE_ID: ${{ env.RELEASE_ID }}
|
-H "Authorization: token $HW_TOKEN" \
|
||||||
run: |
|
-H 'Content-Type: application/json' \
|
||||||
API="https://git.wlkns.org/api/v1/repos/wlkns-dev/hoerwerk"
|
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER — AppImage, deb und Arch-Paket.\",\"draft\":false,\"prerelease\":false}" \
|
||||||
f=$(find . -name "hoerwerk-*.pkg.tar.zst" -type f | head -1)
|
-w '\n%{http_code}' \
|
||||||
|
-o /tmp/hw-rel-body2.json \
|
||||||
|
"$HW_API/releases"
|
||||||
|
}
|
||||||
|
get_release() {
|
||||||
|
curl -sS -H "Authorization: token $HW_TOKEN" \
|
||||||
|
-w '\n%{http_code}' -o /tmp/hw-rel-body2.json \
|
||||||
|
"$HW_API/releases/tags/$VER"
|
||||||
|
}
|
||||||
|
|
||||||
|
code=$(post_release | tail -n1)
|
||||||
|
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body2.json | head -n1 | grep -o '[0-9]*')
|
||||||
|
if [ -z "$RID" ] && [ "$code" != "201" ]; then
|
||||||
|
get_release >/dev/null
|
||||||
|
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body2.json | head -n1 | grep -o '[0-9]*')
|
||||||
|
fi
|
||||||
|
if [ -z "$RID" ]; then
|
||||||
|
echo "Release-ID konnte nicht ermittelt werden (code=$code)"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "Release-ID: $RID"
|
||||||
|
|
||||||
|
f=$(find "$PWD" -name "hoerwerk-*.pkg.tar.zst" -type f | head -n1)
|
||||||
|
[ -n "$f" ] || { echo "kein pkg.tar.zst gefunden"; exit 1; }
|
||||||
echo "Lade $(basename "$f") hoch…"
|
echo "Lade $(basename "$f") hoch…"
|
||||||
curl -sf -X POST \
|
c=$(curl -sS -X POST -H "Authorization: token $HW_TOKEN" \
|
||||||
-H "Authorization: token $GITHUB_TOKEN" \
|
|
||||||
-F "attachment=@$f" \
|
-F "attachment=@$f" \
|
||||||
"$API/releases/$RELEASE_ID/assets?name=$(basename "$f")"
|
-o /tmp/hw-upload2.json -w '%{http_code}' \
|
||||||
|
"$HW_API/releases/$RID/assets?name=$(basename "$f")")
|
||||||
|
echo "Upload-Code: $c"
|
||||||
|
case "$c" in 200|201) echo ok;; *) cat /tmp/hw-upload2.json; exit 1;; esac
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoerwerk",
|
"name": "hoerwerk",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.0",
|
"version": "0.1.4",
|
||||||
"description": "Hörwerk – lokaler Audible-Hörbuch-Player",
|
"description": "Hörwerk – lokaler Audible-Hörbuch-Player",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
# Maintainer: Stephan Wilkens
|
# Maintainer: Stephan Wilkens
|
||||||
pkgname=hoerwerk
|
pkgname=hoerwerk
|
||||||
pkgver=0.1.0
|
pkgver=0.1.4
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='Lokaler Hörbuch-Player für die eigene Audible-Bibliothek (Tauri 2 + Svelte)'
|
pkgdesc='Lokaler Hörbuch-Player für die eigene Audible-Bibliothek (Tauri 2 + Svelte)'
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "hoerwerk"
|
name = "hoerwerk"
|
||||||
version = "0.1.0"
|
version = "0.1.4"
|
||||||
description = "Hörwerk – lokaler Audible-Hörbuch-Player"
|
description = "Hörwerk – lokaler Audible-Hörbuch-Player"
|
||||||
authors = ["Stephan"]
|
authors = ["Stephan"]
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "hoerwerk",
|
"productName": "hoerwerk",
|
||||||
"version": "0.1.0",
|
"version": "0.1.4",
|
||||||
"identifier": "com.hoerwerk.app",
|
"identifier": "com.hoerwerk.app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
@ -893,5 +893,5 @@
|
|||||||
{#if error}
|
{#if error}
|
||||||
<span class="statcell statflex error">{error}</span>
|
<span class="statcell statflex error">{error}</span>
|
||||||
{/if}
|
{/if}
|
||||||
<span class="statcell statend">Hörwerk 0.1.0</span>
|
<span class="statcell statend">Hörwerk 0.1.4</span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user