Compare commits
1 Commits
2877edee69
...
v2.3.0
| Author | SHA1 | Date | |
|---|---|---|---|
| 42e3cf0dec |
@@ -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."
|
||||||
|
|||||||
Reference in New Issue
Block a user