Compare commits

...

5 Commits

Author SHA1 Message Date
Claude
928102bcd5 CI: коміт exe у main без [skip ci], бо Gitea пропускає й тег на такому коміті
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZvw4JH3iemf15ZHHG7
2026-11-26 14:23:39 +00:00
Gitea Actions
63a752356f game_godot: TinMerezhi.exe v1.0.54 [skip ci] 2026-11-26 13:41:37 +00:00
JunioR
46ea914b84 CI: exe у LFS завантажується через внутрішню адресу (ci/lfs_upload.py), бо git-lfs ходить на публічну
All checks were successful
ci-image / image (push) Successful in 14s
build / build (push) Successful in 2m19s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZuvQKryAdo6yY4xecB
2026-11-26 13:37:11 +00:00
JunioR
201ea02b05 CI: LFS-посилання переписуються з публічної адреси на внутрішню (крок exe в game_godot)
Some checks failed
build / build (push) Failing after 2m20s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZuvQKryAdo6yY4xecB
2026-11-26 13:31:14 +00:00
JunioR
7637823acd game_godot: лише остання версія exe в репо через Git LFS (CI комітить її після тегу релізу)
Some checks failed
ci-image / image (push) Successful in 5m21s
build / build (push) Failing after 2m56s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017HrHZuvQKryAdo6yY4xecB
2026-11-26 13:20:49 +00:00
7 changed files with 62 additions and 3 deletions

2
.gitattributes vendored
View File

@@ -6,3 +6,5 @@
*.ico binary
*.ttf binary
*.exe binary
# only the latest exe, in Git LFS: old versions do not bloat the history (CI commits it after each release tag)
game_godot/TinMerezhi.exe filter=lfs diff=lfs merge=lfs -text

View File

@@ -130,3 +130,26 @@ jobs:
run: |
if [ -z "$BUTLER_API_KEY" ] || [ -z "$ITCH_TARGET" ]; then echo "itch.io: no BUTLER_API_KEY / ITCH_TARGET, skipped"; exit 0; fi
butler push game_godot "$ITCH_TARGET:windows" --userversion "${TAG#v}"
- name: Latest exe into game_godot/ on main (Git LFS, replaces the previous one)
if: startsWith(github.ref, 'refs/tags/')
env:
TOKEN: ${{ secrets.RELEASE_TOKEN || secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
GIT_LFS_SKIP_SMUDGE: "1" # do not download the previous exe on checkout
run: |
R="http://x:$TOKEN@gitea:3000/${{ github.repository }}.git"
cp game_godot/TinMerezhi.exe /tmp/TinMerezhi.exe
git config user.name "Gitea Actions"; git config user.email "actions@localhost"
# LFS clean filter only: ci/lfs_upload.py uploads the exe over the internal address, push skips the git-lfs hook
git lfs install --local --skip-repo
git fetch -q "$R" main && git checkout -qf -B main FETCH_HEAD
cp /tmp/TinMerezhi.exe game_godot/TinMerezhi.exe
git add game_godot/TinMerezhi.exe
git show :game_godot/TinMerezhi.exe | head -c 200 | grep -q git-lfs || { echo "exe is not an LFS pointer, refusing to commit it into git"; exit 1; }
if git diff --cached --quiet; then echo "exe unchanged"; exit 0; fi
python3 ci/lfs_upload.py "$R" game_godot/TinMerezhi.exe
# no [skip ci]: Gitea would also skip the next tag placed on this commit; a push to main only runs the tests
git commit -qm "game_godot: TinMerezhi.exe $TAG"
git push -q --no-verify "$R" HEAD:main
echo "main: game_godot/TinMerezhi.exe = $TAG"

1
.gitignore vendored
View File

@@ -1,7 +1,6 @@
# Godot cache and builds
.godot/
*.tmp
game_godot/*.exe
source_godot/tools/template.exe
source_godot/tools/icon.ico
# old exe parts and update folders

View File

@@ -3,7 +3,7 @@
# Built on the server by ci/build_image.sh (workflow ci-image.yml) as the local image tinmerezhi-ci:4.7.2.
FROM node:20-bookworm
ARG GODOT_VER=4.7.2
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends python3-fonttools \
RUN apt-get update -qq && DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends python3-fonttools git-lfs \
wine64 wine xvfb xauth libgl1-mesa-dri \
&& rm -rf /var/lib/apt/lists/*
RUN curl -sSL --fail -o /tmp/g.zip "https://github.com/godotengine/godot/releases/download/${GODOT_VER}-stable/Godot_v${GODOT_VER}-stable_linux.x86_64.zip" \

31
ci/lfs_upload.py Normal file
View File

@@ -0,0 +1,31 @@
"""Uploads one file to the Gitea LFS store over the internal address.
git-lfs in the job cannot do it: the server answers with links to the public ROOT_URL (Funnel), unreachable from the job.
Usage: python3 ci/lfs_upload.py http://x:TOKEN@gitea:3000/owner/repo.git FILE"""
import base64, hashlib, json, os, sys, urllib.parse, urllib.request
remote, path = sys.argv[1], sys.argv[2]
u = urllib.parse.urlsplit(remote)
base = f"{u.scheme}://{u.hostname}" + (f":{u.port}" if u.port else "")
auth = "Basic " + base64.b64encode(f"{u.username}:{u.password}".encode()).decode()
data = open(path, "rb").read()
oid, size = hashlib.sha256(data).hexdigest(), len(data)
T = "application/vnd.git-lfs+json"
def call(url, body, headers, method="POST", ctype=T):
# keep only the path of the server's link and send it to the internal address
p = urllib.parse.urlsplit(url)
req = urllib.request.Request(base + p.path + (f"?{p.query}" if p.query else ""), data=body, method=method,
headers={**headers, "Content-Type": ctype, "Accept": T})
with urllib.request.urlopen(req) as r:
return r.read()
batch = json.dumps({"operation": "upload", "transfers": ["basic"], "objects": [{"oid": oid, "size": size}]}).encode()
obj = json.loads(call(f"{base}{u.path}/info/lfs/objects/batch", batch, {"Authorization": auth}))["objects"][0]
if "error" in obj:
sys.exit(f"LFS batch error: {obj['error']}")
act = obj.get("actions") or {}
if "upload" in act:
call(act["upload"]["href"], data, act["upload"].get("header", {}), "PUT", "application/octet-stream")
if "verify" in act:
call(act["verify"]["href"], json.dumps({"oid": oid, "size": size}).encode(), act["verify"].get("header", {}))
print(f"LFS {oid[:12]} ({size} bytes): {'uploaded' if 'upload' in act else 'already on the server'}")

BIN
game_godot/TinMerezhi.exe (Stored with Git LFS) Normal file

Binary file not shown.

View File

@@ -5,7 +5,8 @@
ЩОБ ПРОСТО ГРАТИ
----------------
game_godot\TinMerezhi.exe — гра (рушій Godot), Windows 10/11 64-біт.
Якщо exe тут немає (копія з git), завантаж його з https://tuberon.itch.io/tinmerezhi
У git exe лежить через Git LFS (лише остання версія). Якщо після git clone файл
важить ~130 байт, виконай один раз: git lfs install && git lfs pull. Або завантаж exe з https://tuberon.itch.io/tinmerezhi
або з Releases: https://serv.tail9357bc.ts.net/junior/TinMerezhi/releases/latest
Інструкція й усі команди — у game_godot\ПРОЧИТАЙ.txt.