diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index bb1c8d5..f7afbf3 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -21,9 +21,9 @@ permissions: env: TAG: ${{ github.event.release.tag_name || inputs.tag }} - # Gitea's internal address. Uploads bypass the Cloudflare tunnel, which - # rejects request bodies as large as the mod jars (413). - GITEA_API: http://gitea:3000/api/v1 + # The public address. Uploads go through the Cloudflare tunnel, which caps + # request bodies at 100 MB, so each mod jar must stay under that. + GITEA_API: ${{ github.server_url }}/api/v1 jobs: build: @@ -69,6 +69,15 @@ jobs: exit 1 fi + # Cloudflare in front of the server rejects uploads of 100 MB or more. + for jar in "${jars[@]}"; do + size=$(stat -c%s "$jar") + if [ "$size" -ge 100000000 ]; then + echo "::error::$(basename "$jar") is $((size / 1000000)) MB; uploads must be under 100 MB. Check what's taking space with: unzip -l \"$jar\" | sort -n" >&2 + exit 1 + fi + done + # Look the release up by tag so manual runs work too. RELEASE_ID="$(curl --fail-with-body -sS -H "Authorization: token $TOKEN" \ "$GITEA_API/repos/$REPO/releases/tags/$TAG" \