Compare commits

..
5 Commits
Author SHA1 Message Date
selimaj-dev 14c16d8fe0 Merge pull request 'Release workflow: upload through the public URL again; smaller jars' (#14) from release-public-url into master
Release / build (release) Successful in 18m36s
2026-09-25 16:36:40 +00:00
selimaj-devandclaude e3d1e4a442 Point common at the panorama downscale merge commit
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 18:36:24 +02:00
selimaj-devandclaude 04605f6855 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]>
2026-09-25 18:31:14 +02:00
selimaj-dev 451ac986c0 Merge pull request 'Release workflow: upload through Gitea's internal address; add manual trigger' (#13) from release-upload-internal-url into master
Reviewed-on: #13
2026-09-25 15:35:17 +00:00
selimaj-devandclaude 80d478d2c9 Upload release jars through Gitea's internal address
The Cloudflare tunnel in front of git.selimaj.dev rejects the jar
uploads with 413 Payload Too Large. Call the API at http://gitea:3000
instead, look the release up by tag, and add a workflow_dispatch trigger
that builds a given tag and attaches the jars to its existing release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-09-25 17:32:52 +02:00
2 changed files with 37 additions and 6 deletions
+36 -5
View File
@@ -4,13 +4,27 @@ name: Release
# to it. mod_version in gradle.properties is the source of truth: the release # to it. mod_version in gradle.properties is the source of truth: the release
# tag must match it (a leading "v" is allowed), so bump mod_version in a PR # tag must match it (a leading "v" is allowed), so bump mod_version in a PR
# before tagging the release. # before tagging the release.
#
# To (re)attach jars to an existing release, run this workflow manually with
# the release's tag.
on: on:
release: release:
types: [published] types: [published]
workflow_dispatch:
inputs:
tag:
description: Tag of the existing release to build and attach jars to
required: true
permissions: permissions:
contents: write contents: write
env:
TAG: ${{ github.event.release.tag_name || inputs.tag }}
# 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: jobs:
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -18,11 +32,10 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ env.TAG }}
submodules: true submodules: true
- name: Check tag matches mod_version - name: Check tag matches mod_version
env:
TAG: ${{ github.event.release.tag_name }}
run: | run: |
MOD_VERSION="$(sed -n 's/^mod_version=//p' gradle.properties | tr -d '[:space:]')" MOD_VERSION="$(sed -n 's/^mod_version=//p' gradle.properties | tr -d '[:space:]')"
if [ "${TAG#v}" != "$MOD_VERSION" ]; then if [ "${TAG#v}" != "$MOD_VERSION" ]; then
@@ -47,7 +60,7 @@ jobs:
- name: Upload jars to the release - name: Upload jars to the release
env: env:
TOKEN: ${{ secrets.GITEA_TOKEN }} TOKEN: ${{ secrets.GITEA_TOKEN }}
ASSETS_URL: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}/releases/${{ github.event.release.id }}/assets REPO: ${{ github.repository }}
run: | run: |
shopt -s nullglob shopt -s nullglob
jars=(build/allJars/*.jar) jars=(build/allJars/*.jar)
@@ -56,11 +69,29 @@ jobs:
exit 1 exit 1
fi fi
# Cloudflare in front of the server rejects uploads of 100 MB or more.
for jar in "${jars[@]}"; do for jar in "${jars[@]}"; do
echo "Uploading $(basename "$jar")" 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" \
| grep -o '"id":[0-9]*' | head -n1 | cut -d: -f2)"
if [ -z "$RELEASE_ID" ]; then
echo "No release found for tag $TAG" >&2
exit 1
fi
for jar in "${jars[@]}"; do
echo "Uploading $(basename "$jar") to release $TAG ($RELEASE_ID)"
curl --fail-with-body -sS -X POST \ curl --fail-with-body -sS -X POST \
-H "Authorization: token $TOKEN" \ -H "Authorization: token $TOKEN" \
-F "attachment=@$jar" \ -F "attachment=@$jar" \
"$ASSETS_URL" "$GITEA_API/repos/$REPO/releases/$RELEASE_ID/assets"
echo echo
done done
+1 -1
Submodule common updated: 98da42992e...5df42e2b7c