feat(site): redesigned /download, releases and links moved from GitHub to Forgejo
Some checks failed
CI / backend (cargo test + clippy) (push) Has been cancelled
CI / frontend (lint + test + build) (push) Has been cancelled
CI / mod (gradle test + checkFolderLimit) (push) Has been cancelled

- /download: the jar as an in-game item (pixel heart in an inventory slot, vanilla-style tooltip with version, size and SHA-256, copy button), spec list, three install steps, release timeline
- releases read through a cached nginx proxy (/api/releases): Forgejo's API has no CORS headers
- README, footer and landing links point to git.wihuk.pro/boba/LoVisual (the GitHub repo they used does not exist)
- release workflow publishes through the Forgejo API and ships lovisual.jar.sha256
- fix i18n interpolation placeholders ({{x}}) in the download strings
This commit is contained in:
loki5512344 2026-10-09 22:15:55 +02:00
parent fa08d50704
commit 2d96f28091
Signed by: boba
GPG key ID: 253067914055423B
19 changed files with 360 additions and 143 deletions

View file

@ -17,6 +17,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 25
uses: actions/setup-java@v4
@ -46,11 +48,28 @@ jobs:
echo "version=$version" >>"$GITHUB_OUTPUT"
echo "Packaged $jar as lovisual-$version.jar and lovisual.jar"
- name: Publish the GitHub release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
generate_release_notes: true
files: |
lovisual-${{ steps.jar.outputs.version }}.jar
lovisual.jar
# The repository lives on Forgejo, so the release goes through its API.
# One-time setup: Settings > Actions > Secrets > RELEASE_TOKEN (an API
# token with write access to this repository's releases).
- name: Publish the Forgejo release
env:
TOKEN: ${{ secrets.RELEASE_TOKEN }}
API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }}
TAG: ${{ github.ref_name }}
VERSION: ${{ steps.jar.outputs.version }}
run: |
set -euo pipefail
test -n "$TOKEN" || { echo "RELEASE_TOKEN secret is missing"; exit 1; }
sha256sum lovisual.jar > lovisual.jar.sha256
prev="$(git describe --tags --abbrev=0 "$TAG^" 2>/dev/null || true)"
range="${prev:+$prev..}$TAG"
notes="$(git log --no-merges --pretty='- %s' "$range" | head -60)"
body="$(python3 -c 'import json,sys; print(json.dumps({"tag_name":sys.argv[1],"name":sys.argv[1],"body":sys.argv[2]}))' "$TAG" "$notes")"
id="$(curl -fsS -X POST "$API/releases" -H "Authorization: token $TOKEN" \
-H 'Content-Type: application/json' -d "$body" \
| python3 -c 'import json,sys; print(json.load(sys.stdin)["id"])')"
for f in "lovisual-$VERSION.jar" lovisual.jar lovisual.jar.sha256; do
curl -fsS -X POST "$API/releases/$id/assets?name=$f" -H "Authorization: token $TOKEN" \
-F "attachment=@$f" >/dev/null
echo "uploaded $f"
done