Clean docs of host-specific release and contact details.

Describe releases generically and use the same git credentials as push.
This commit is contained in:
Dominic Gundel committed 2026-10-19 16:18:05 +02:00
1 parent 2c02038e8c
commit 7d71ae8dde
7 files changed
+56 -64

No files matched your search

+26 -11
View File
@@ -1,8 +1,8 @@
#!/usr/bin/env bash
# Baut das ZIP eines Skills und legt damit ein Gitea-Release an.
# Kein Actions-Runner. Der Tag <name>/v<version> muss lokal und auf dem Server liegen.
# Token: Umgebungsvariable GITEA_TOKEN (persönliches Zugangs-Token, nicht ins Repo).
# Aufruf: scripts/release.sh <skill-name>
# Builds the skill ZIP (and .mcpb if extension/) and creates a remote release with those assets.
# Auth: git credential helper, or env RELEASE_TOKEN if set.
# The tag <name>/v<version> must exist locally and on the remote. Does not push tags.
# Usage: scripts/release.sh <skill-name>
set -euo pipefail
source "$(dirname "$0")/lib.sh"
@@ -11,15 +11,31 @@ if [[ -z "$name" ]]; then
echo "Aufruf: scripts/release.sh <skill-name>" >&2
exit 1
fi
if [[ -z "${GITEA_TOKEN:-}" ]]; then
echo "GITEA_TOKEN fehlt. Persönliches Zugangs-Token mit Schreibrecht (write:repository), nur in der Umgebung." >&2
exit 1
fi
if ! command -v python3 >/dev/null 2>&1 || ! command -v curl >/dev/null 2>&1; then
echo "release.sh braucht curl und python3. Unter Windows: scripts\\release.ps1" >&2
exit 1
fi
REPO_HOST=git.gundel.dev
api="https://$REPO_HOST/api/v1/repos/dg/claude-skills"
auth_header=""
if [[ -n "${RELEASE_TOKEN:-}" ]]; then
auth_header="Authorization: token $RELEASE_TOKEN"
else
cred="$(printf 'protocol=https\nhost=%s\n\n' "$REPO_HOST" | git credential fill 2>/dev/null || true)"
user="$(printf '%s\n' "$cred" | sed -n 's/^username=//p' | head -n1)"
pass="$(printf '%s\n' "$cred" | sed -n 's/^password=//p' | head -n1)"
if [[ -n "$user" && -n "$pass" ]]; then
basic="$(printf '%s:%s' "$user" "$pass" | base64 | tr -d '\n')"
auth_header="Authorization: Basic $basic"
fi
fi
if [[ -z "$auth_header" ]]; then
echo "Keine Auth fuer das Release (git credential oder RELEASE_TOKEN)." >&2
exit 1
fi
dir="$SKILLS_DIR/$name"
version="$(skill_version "$dir")"
if [[ -z "$version" ]]; then
@@ -55,10 +71,9 @@ print(json.dumps({
"body": open(os.environ["NOTES"], encoding="utf-8").read().strip(),
}))' > "$payload"
api="https://git.gundel.dev/api/v1/repos/dg/claude-skills"
resp="$(mktemp)"
code="$(curl -sS -o "$resp" -w '%{http_code}' -X POST "$api/releases" \
-H "Authorization: token $GITEA_TOKEN" \
-H "$auth_header" \
-H "Content-Type: application/json" \
--data-binary @"$payload")"
if [[ "$code" != "201" ]]; then
@@ -78,7 +93,7 @@ upload_asset() {
local asset_resp code asset download
asset_resp="$(mktemp)"
code="$(curl -sS -o "$asset_resp" -w '%{http_code}' -X POST "$api/releases/$rel_id/assets?name=$file_name" \
-H "Authorization: token $GITEA_TOKEN" \
-H "$auth_header" \
-H "Content-Type: application/octet-stream" \
--data-binary @"$file_path")"
if [[ "$code" != "201" ]]; then