Upload release jars through the public URL again, with a size guard
gitea:3000 isn't resolvable from act_runner's job containers, which run on their own Docker network. With the panorama downscaled in common the jars are ~45 MB, under the Cloudflare tunnel's 100 MB request limit, so upload through github.server_url again. Fail with a readable error before uploading if any jar is 100 MB or more. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -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" \
|
||||
|
||||
Reference in New Issue
Block a user