diff --git a/.gitea/workflows/release.yaml b/.gitea/workflows/release.yaml index d083f5d..92dd4e2 100644 --- a/.gitea/workflows/release.yaml +++ b/.gitea/workflows/release.yaml @@ -167,7 +167,7 @@ jobs: API_RESPONSE=$(curl -s -X POST "$API_URL" \ -H "accept: application/json" \ - -H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \ + -H "Authorization: token $RELEASE_TOKEN" \ -H "Content-Type: application/json" \ -d "$JSON") @@ -187,4 +187,30 @@ jobs: TAG: ${{ steps.daten.outputs.version }} PLUGIN_NAME: ${{ steps.daten.outputs.name }} PLUGIN_GROUP: ${{ steps.daten.outputs.group }} + RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} + + - name: ZIP-Datei hochladen + run: | + RELEASE_ID="${{ steps.create_release.outputs.release_id }}" + ZIP_FILE="${{ steps.zip.outputs.zip_file }}" + + API_URL="https://${{ vars.RELEASE_URL }}/api/v1/repos/${PLUGIN_GROUP}/${PLUGIN_NAME}/releases/${RELEASE_ID}/assets?name=${ZIP_FILE}" + + curl -s -X POST "$API_URL" \ + -H "Authorization: token $RELEASE_TOKEN" \ + -H "Content-Type: application/zip" \ + --data-binary "@repo/dist/${ZIP_FILE}" \ + -o upload_response.json + + # Optional: Fehlerprüfung + if jq -e '.id' upload_response.json >/dev/null 2>&1; then + echo "ZIP erfolgreich hochgeladen." + else + echo "Fehler beim Hochladen der ZIP!" + cat upload_response.json + exit 1 + fi + env: + PLUGIN_NAME: ${{ steps.daten.outputs.name }} + PLUGIN_GROUP: ${{ steps.daten.outputs.group }} RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} \ No newline at end of file