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:
@@ -77,28 +77,47 @@ jobs:
|
||||
sha256sum *.zip > checksums-sha256.txt
|
||||
cat checksums-sha256.txt
|
||||
|
||||
# Gitea-native Release-Action. Legt das Release an, falls der Tag noch
|
||||
# keins hat, oder aktualisiert das bestehende und haengt die Assets an.
|
||||
# Der auto-injizierte GITHUB_TOKEN auf Gitea Actions hat Gitea-API-Scope
|
||||
# und reicht fuer Release-Write.
|
||||
- name: Attach to Gitea release
|
||||
uses: https://gitea.com/actions/release-action@main
|
||||
with:
|
||||
files: |-
|
||||
dist/hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip
|
||||
dist/hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip
|
||||
dist/hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip
|
||||
dist/checksums-sha256.txt
|
||||
api_key: ${{ secrets.GITHUB_TOKEN }}
|
||||
body: |
|
||||
## Hellion NewTab ${{ steps.version.outputs.tag }}
|
||||
# Release per Gitea-API (curl), NICHT via gitea.com/actions/release-action: die ist `using: go`
|
||||
# und stirbt auf diesem Runner mit exit 127 ("go not found"), weil act_runner v0.6.1 die go-Action
|
||||
# weder im Job-Image noch im Runner kompiliert bekommt. curl + python3 sind im Job-Image vorhanden
|
||||
# und laufen als normaler Step -> unabhaengig von go-Toolchain, Action-Cache und @main-Drift.
|
||||
# GITHUB_API_URL/GITHUB_REPOSITORY/GITHUB_TOKEN injiziert Gitea Actions automatisch.
|
||||
- name: Create release & upload assets (Gitea API)
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG: ${{ steps.version.outputs.tag }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
API="${GITHUB_API_URL:-https://gitea.hellion-forge.cloud/api/v1}"
|
||||
REPO="${GITHUB_REPOSITORY}"
|
||||
AUTH="Authorization: token ${GITEA_TOKEN}"
|
||||
|
||||
### Installation
|
||||
- **Chrome / Edge / Brave / Vivaldi:** `hellion-newtab-${{ steps.version.outputs.tag }}-chrome.zip`
|
||||
- **Firefox:** `hellion-newtab-${{ steps.version.outputs.tag }}-firefox.zip`
|
||||
- **Opera / Opera GX:** `hellion-newtab-${{ steps.version.outputs.tag }}-opera.zip`
|
||||
# Release-Request-JSON (Body inkl. Installationshinweise) als python-Einzeiler bauen
|
||||
# (mehrzeilig wuerde den YAML-run-Block brechen: Zeilen auf Spalte 0).
|
||||
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}))')
|
||||
|
||||
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
|
||||
`checksums-sha256.txt` zum Verifizieren der Dateiintegritaet.
|
||||
# Vorhandene gleichnamige Assets entfernen (idempotent bei Re-Runs), dann hochladen.
|
||||
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."
|
||||
|
||||
Reference in New Issue
Block a user