Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2781fef3ff | |||
| aac4205a45 | |||
| 421e7eeb03 |
15
.gitea/workflows/probe.yml
Normal file
15
.gitea/workflows/probe.yml
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
name: secret-probe
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
jobs:
|
||||||
|
probe-arch:
|
||||||
|
runs-on: arch-base-devel
|
||||||
|
env:
|
||||||
|
HW_TOKEN: ${{ secrets.HW_RELEASE_TOKEN }}
|
||||||
|
steps:
|
||||||
|
- name: secret-echo-sicher
|
||||||
|
run: |
|
||||||
|
echo "curl da? $(command -v curl || echo FEHLT)"
|
||||||
|
echo "ref_name set? ${GITHUB_REF_NAME:+ja len=${#GITHUB_REF_NAME}}"
|
||||||
|
echo "token len in container: ${#HW_TOKEN}"
|
||||||
|
echo "user-code: $(curl -sS -o /dev/null -w '%{http_code}' -H "Authorization: token $HW_TOKEN" https://git.wlkns.org/api/v1/user)"
|
||||||
@ -40,29 +40,41 @@ jobs:
|
|||||||
VER="$GITHUB_REF_NAME"
|
VER="$GITHUB_REF_NAME"
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
|
release_body() {
|
||||||
|
echo -n "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER — AppImage, deb und Arch-Paket.\",\"draft\":false,\"prerelease\":false}"
|
||||||
|
}
|
||||||
post_release() {
|
post_release() {
|
||||||
|
body=$(release_body)
|
||||||
curl -sS -X POST \
|
curl -sS -X POST \
|
||||||
-H "Authorization: token $HW_TOKEN" \
|
-H "Authorization: token $HW_TOKEN" \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER — AppImage, deb und Arch-Paket.\",\"draft\":false,\"prerelease\":false}" \
|
-d "$body" \
|
||||||
-w '\n%{http_code}' \
|
-w '\n%{http_code}' \
|
||||||
-o /tmp/hw-rel-body.json \
|
$curl_out_flag \
|
||||||
"$HW_API/releases"
|
"$HW_API/releases" || true
|
||||||
}
|
}
|
||||||
get_release() {
|
get_release() {
|
||||||
curl -sS -H "Authorization: token $HW_TOKEN" \
|
curl -sS -H "Authorization: token $HW_TOKEN" \
|
||||||
-w '\n%{http_code}' -o /tmp/hw-rel-body.json \
|
-w '\n%{http_code}' -o $curl_out_flag \
|
||||||
"$HW_API/releases/tags/$VER"
|
"$HW_API/releases/tags/$VER" || true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Body-Datei immer beschreiben (auch bei Fehlstatus)
|
||||||
|
curl_out_flag=('/tmp/hw-rel-body.json')
|
||||||
code=$(post_release | tail -n1)
|
code=$(post_release | tail -n1)
|
||||||
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body.json | head -n1 | grep -o '[0-9]*')
|
body_text=$(cat /tmp/hw-rel-body.json 2>/dev/null || echo)
|
||||||
if [ -z "$RID" ] && [ "$code" != "201" ]; then
|
RID=$(echo "$body_text" | grep -o '"id": *[0-9]*' | head -n1 | grep -o '[0-9]*' || true)
|
||||||
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
|
if [ -z "$RID" ]; then
|
||||||
echo "Release-ID konnte nicht ermittelt werden (code=$code)"
|
echo "POST-Code: $code — Fallback: Suche via Tag"
|
||||||
|
curl_out_flag=('/tmp/hw-rel-body.json')
|
||||||
|
get_release | tail -n1
|
||||||
|
body_text=$(cat /tmp/hw-rel-body.json 2>/dev/null || echo)
|
||||||
|
RID=$(echo "$body_text" | grep -o '"id": *[0-9]*' | head -n1 | grep -o '[0-9]*' || true)
|
||||||
|
fi
|
||||||
|
RID=${RID:-}
|
||||||
|
if [ -z "$RID" ]; then
|
||||||
|
echo "Release-ID nicht ermittelbar — Body:"
|
||||||
|
echo "$body_text" | head -c 400
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "Release-ID: $RID"
|
echo "Release-ID: $RID"
|
||||||
@ -111,24 +123,24 @@ jobs:
|
|||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER — AppImage, deb und Arch-Paket.\",\"draft\":false,\"prerelease\":false}" \
|
-d "{\"tag_name\":\"$VER\",\"name\":\"Hörwerk $VER\",\"body\":\"Release $VER — AppImage, deb und Arch-Paket.\",\"draft\":false,\"prerelease\":false}" \
|
||||||
-w '\n%{http_code}' \
|
-w '\n%{http_code}' \
|
||||||
-o /tmp/hw-rel-body2.json \
|
-o /tmp/hw-rel-body.json \
|
||||||
"$HW_API/releases"
|
"$HW_API/releases"
|
||||||
}
|
}
|
||||||
get_release() {
|
get_release() {
|
||||||
curl -sS -H "Authorization: token $HW_TOKEN" \
|
curl -sS -H "Authorization: token $HW_TOKEN" \
|
||||||
-w '\n%{http_code}' -o /tmp/hw-rel-body2.json \
|
-w '\n%{http_code}' -o /tmp/hw-rel-body.json \
|
||||||
"$HW_API/releases/tags/$VER"
|
"$HW_API/releases/tags/$VER"
|
||||||
}
|
}
|
||||||
|
|
||||||
code=$(post_release | tail -n1)
|
code=$(post_release | tail -n1)
|
||||||
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body2.json | head -n1 | grep -o '[0-9]*')
|
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body.json 2>/dev/null | head -n1 | grep -o '[0-9]*' || true)
|
||||||
if [ -z "$RID" ] && [ "$code" != "201" ]; then
|
if [ -z "$RID" ]; then
|
||||||
get_release >/dev/null
|
echo "POST-Code: $code — Fallback via Tag-Lookup"
|
||||||
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body2.json | head -n1 | grep -o '[0-9]*')
|
get_release >/dev/null 2>&1
|
||||||
|
RID=$(grep -o '"id": *[0-9]*' /tmp/hw-rel-body.json 2>/dev/null | head -n1 | grep -o '[0-9]*' || true)
|
||||||
fi
|
fi
|
||||||
if [ -z "$RID" ]; then
|
if [ -z "$RID" ]; then
|
||||||
echo "Release-ID konnte nicht ermittelt werden (code=$code)"
|
echo "Release-ID konnte nicht ermittelt werden (code=$code)"; exit 1
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
echo "Release-ID: $RID"
|
echo "Release-ID: $RID"
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "hoerwerk",
|
"name": "hoerwerk",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.1.4",
|
"version": "0.1.6",
|
||||||
"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.4
|
pkgver=0.1.6
|
||||||
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.4"
|
version = "0.1.6"
|
||||||
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.4",
|
"version": "0.1.6",
|
||||||
"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.4</span>
|
<span class="statcell statend">Hörwerk 0.1.6</span>
|
||||||
</footer>
|
</footer>
|
||||||
|
|||||||
Reference in New Issue
Block a user