diff --git a/.gitea/workflows/build-pack.yaml b/.gitea/workflows/build-pack.yaml index 12fcb9f..43297df 100644 --- a/.gitea/workflows/build-pack.yaml +++ b/.gitea/workflows/build-pack.yaml @@ -137,10 +137,19 @@ jobs: - name: Release if: startsWith(github.ref, 'refs/tags/v') - uses: softprops/action-gh-release@v1 - with: - files: | - SciCraft-Modrinth.mrpack - SciCraft-CurseForge.zip - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + run: | + set -e + TAG="${GITHUB_REF_NAME}" + API="https://git.mithraic.cloud/api/v1/repos/ad3laid3/SciCraft/releases" + AUTH="Authorization: token ${{ secrets.GITHUB_TOKEN }}" + RELEASE_JSON=$(curl -sS -X POST "$API" \ + -H "$AUTH" \ + -H "Content-Type: application/json" \ + -d "{\"tag_name\":\"$TAG\",\"name\":\"SCICRAFT $TAG\",\"body\":\"Automated release built from Gitea Actions.\"}") + RELEASE_ID=$(printf '%s' "$RELEASE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])") + for f in SciCraft-Modrinth.mrpack SciCraft-CurseForge.zip; do + curl -sS -X POST "$API/$RELEASE_ID/assets?name=$(basename "$f")" \ + -H "$AUTH" \ + -F "attachment=@$f" + echo "Uploaded $f" + done \ No newline at end of file