ci(release): Release via Gitea-API (curl) statt go-basierter release-action

Die gitea.com/actions/release-action ist 'using: go' und scheitert auf dem Forge-Runner
mit exit 127 — act_runner v0.6.1 bekommt die go-Action weder im Job-Image noch im Runner
kompiliert ('go: executable file not found'). Der Schritt legt das Release jetzt per curl
gegen die Gitea-API an und laedt die Assets hoch, idempotent (vorhandenes Release/Assets
werden wiederverwendet bzw. ersetzt). Laeuft als normaler run-Step im Job-Image und ist
damit unabhaengig von go-Toolchain, Action-Cache und @main-Drift.
This commit is contained in:
2026-06-14 21:05:36 +02:00
parent 2877edee69
commit 2150f98cd4
+41 -22
View File
@@ -77,28 +77,47 @@ jobs:
sha256sum *.zip > checksums-sha256.txt sha256sum *.zip > checksums-sha256.txt
cat checksums-sha256.txt cat checksums-sha256.txt
# Gitea-native Release-Action. Legt das Release an, falls der Tag noch # Release per Gitea-API (curl), NICHT via gitea.com/actions/release-action: die ist `using: go`
# keins hat, oder aktualisiert das bestehende und haengt die Assets an. # und stirbt auf diesem Runner mit exit 127 ("go not found"), weil act_runner v0.6.1 die go-Action
# Der auto-injizierte GITHUB_TOKEN auf Gitea Actions hat Gitea-API-Scope # weder im Job-Image noch im Runner kompiliert bekommt. curl + python3 sind im Job-Image vorhanden
# und reicht fuer Release-Write. # und laufen als normaler Step -> unabhaengig von go-Toolchain, Action-Cache und @main-Drift.
- name: Attach to Gitea release # GITHUB_API_URL/GITHUB_REPOSITORY/GITHUB_TOKEN injiziert Gitea Actions automatisch.
uses: https://gitea.com/actions/release-action@main - name: Create release & upload assets (Gitea API)
with: env:
files: |- GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dist/hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip TAG: ${{ steps.version.outputs.tag }}
dist/hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip run: |
dist/hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip set -euo pipefail
dist/checksums-sha256.txt API="${GITHUB_API_URL:-https://gitea.hellion-forge.cloud/api/v1}"
api_key: ${{ secrets.GITHUB_TOKEN }} REPO="${GITHUB_REPOSITORY}"
body: | AUTH="Authorization: token ${GITEA_TOKEN}"
## Hellion NewTab ${{ steps.version.outputs.tag }}
### Installation # Release-Request-JSON (Body inkl. Installationshinweise) als python-Einzeiler bauen
- **Chrome / Edge / Brave / Vivaldi:** `hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip` # (mehrzeilig wuerde den YAML-run-Block brechen: Zeilen auf Spalte 0).
- **Firefox:** `hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip` REQ=$(python3 -c 'import json,os; t=os.environ["TAG"]; body="## Hellion NewTab "+t+"\n\n### Installation\n- **Chrome / Edge / Brave / Vivaldi:** `hellion-newtab-"+t+"-chrome.zip`\n- **Firefox:** `hellion-newtab-"+t+"-firefox.zip`\n- **Opera / Opera GX:** `hellion-newtab-"+t+"-opera.zip`\n\nVollstaendige Installationsanleitung siehe README.\n\n### Checksums\n`checksums-sha256.txt` zum Verifizieren der Dateiintegritaet."; print(json.dumps({"tag_name": t, "name": "Hellion NewTab "+t, "body": body}))')
- **Opera / Opera GX:** `hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip`
Vollstaendige Installationsanleitung siehe README. # Idempotent: existierendes Release zum Tag wiederverwenden, sonst anlegen.
REL_ID=$(curl -sf -H "$AUTH" "$API/repos/$REPO/releases/tags/$TAG" \
| python3 -c 'import sys,json;print(json.load(sys.stdin).get("id",""))' 2>/dev/null || true)
if [ -z "$REL_ID" ]; then
REL_ID=$(printf '%s' "$REQ" \
| curl -sf -X POST -H "$AUTH" -H "Content-Type: application/json" -d @- "$API/repos/$REPO/releases" \
| python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')
echo "Release angelegt: $REL_ID"
else
echo "Release existiert bereits, wiederverwenden: $REL_ID"
fi
### Checksums # Vorhandene gleichnamige Assets entfernen (idempotent bei Re-Runs), dann hochladen.
`checksums-sha256.txt` zum Verifizieren der Dateiintegritaet. EXIST=$(curl -sf -H "$AUTH" "$API/repos/$REPO/releases/$REL_ID/assets" 2>/dev/null || echo '[]')
for f in dist/hellion-newtab-$TAG-chrome.zip dist/hellion-newtab-$TAG-firefox.zip dist/hellion-newtab-$TAG-opera.zip dist/checksums-sha256.txt; do
name=$(basename "$f")
aid=$(printf '%s' "$EXIST" | NAME="$name" python3 -c 'import sys,json,os;n=os.environ["NAME"];print(next((a["id"] for a in json.load(sys.stdin) if a.get("name")==n), ""))' 2>/dev/null || true)
if [ -n "$aid" ]; then
echo "ersetze vorhandenes Asset $name (id $aid)"
curl -sf -X DELETE -H "$AUTH" "$API/repos/$REPO/releases/$REL_ID/assets/$aid" >/dev/null || true
fi
echo "Upload $name ..."
curl -sf -X POST -H "$AUTH" -F "attachment=@$f" "$API/repos/$REPO/releases/$REL_ID/assets?name=$name" >/dev/null
done
echo "Release $TAG fertig: alle Assets hochgeladen."