patch system: gitea-pages serving, MANIFEST_URL updated

This commit is contained in:
god
2026-07-04 10:00:57 +08:00
parent 7c6f66e821
commit 8414f48106
2 changed files with 34 additions and 110 deletions
+33 -109
View File
@@ -13,137 +13,61 @@ on:
type: string type: string
jobs: jobs:
build-patch: build-and-deploy:
name: Build Patch name: Build & Deploy Patch
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 45 timeout-minutes: 30
env:
ACTIONS_STEP_DEBUG: true
steps: steps:
- name: Uji Koneksi Jaringan & SSH
run: |
echo "Test Ping ke IP Tailscale Gitea..."
ping -c 3 100.79.174.108 || echo "PING GAGAL: Runner tidak bisa akses jaringan Tailscale."
echo "Test Koneksi Port SSH..."
nc -zv 100.79.174.108 222 || echo "PORT GAGAL: Port 222 tertutup dari dalam runner."
- name: Setup SSH config for Gitea
run: |
mkdir -p ~/.ssh
echo -e "Host git.klud.top\n HostName 100.79.174.108\n Port 222\n StrictHostKeyChecking no" > ~/.ssh/config
chmod 600 ~/.ssh/config
git config --global url."ssh://git@100.79.174.108:222/".insteadOf "git@git.klud.top:"
git config --global url."ssh://git@100.79.174.108:222/".insteadOf "https://git.klud.top/"
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 env:
with: GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
fetch-depth: 0 run: |
ssh-key: ${{ secrets.TEKTON_SSH_KEY }} git clone http://god:$GITEA_TOKEN@52.74.133.55:3000/danchie/tekton.git .
ssh-strict: false git config user.name "god"
git config user.email "god@noreply.git.klud.top"
- name: Setup Godot - name: Setup Godot
run: | run: |
if [ -f /cache/Godot_v4.6-stable_linux.x86_64.zip ]; then wget -q https://github.com/godotengine/godot-builds/releases/download/4.7-stable/Godot_v4.7-stable_linux.x86_64.zip -O /tmp/godot.zip
cp -a /cache/Godot_v4.6-stable_linux.x86_64.zip godot.zip unzip -q /tmp/godot.zip -d /tmp/godot
else mv /tmp/godot/Godot_v4.7-stable_linux.x86_64 /usr/local/bin/godot
wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_linux.x86_64.zip -O godot.zip
fi
unzip -q godot.zip
mv Godot_v4.6-stable_linux.x86_64 /usr/local/bin/godot
chmod +x /usr/local/bin/godot chmod +x /usr/local/bin/godot
- name: Install export templates - name: Install export templates
run: | run: |
mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable wget -nv https://github.com/godotengine/godot-builds/releases/download/4.7-stable/Godot_v4.7-stable_export_templates.tpz -O /tmp/godot-templates.tpz
if [ -f /cache/Godot_v4.6-stable_export_templates.tpz ]; then
cp -a /cache/Godot_v4.6-stable_export_templates.tpz /tmp/godot-templates.tpz
else
wget -nv https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz -O /tmp/godot-templates.tpz
fi
unzip -o -q /tmp/godot-templates.tpz -d /tmp/godot-templates unzip -o -q /tmp/godot-templates.tpz -d /tmp/godot-templates
mkdir -p ~/.local/share/godot/export_templates/4.7.stable
if [ -d /tmp/godot-templates/templates ]; then if [ -d /tmp/godot-templates/templates ]; then
cp -a /tmp/godot-templates/templates/* ~/.local/share/godot/export_templates/4.6.stable/ mv /tmp/godot-templates/templates/* ~/.local/share/godot/export_templates/4.7.stable/
else else
cp -a /tmp/godot-templates/* ~/.local/share/godot/export_templates/4.6.stable/ mv /tmp/godot-templates/* ~/.local/share/godot/export_templates/4.7.stable/
fi fi
- name: Run patch build script - name: Generate version.json & bump version
env: env:
PATCH_VERSION: ${{ github.event.inputs.version }} PATCH_VERSION: ${{ github.event.inputs.version }}
PATCH_NOTES: ${{ github.event.inputs.notes }} PATCH_NOTES: ${{ github.event.inputs.notes }}
run: | run: |
python3 patch_version.py "$PATCH_VERSION" "$PATCH_NOTES" python3 tools/generate_version_json.py --skip-changelog
- name: Export Windows patch - name: Export patch PCK
run: | run: |
mkdir -p build godot --headless --export-pack "Windows Desktop" build/patch.pck 2>&1 | tail -5
godot --headless --export-release "Windows Desktop" build/tekton_armageddon_patch_windows.exe
- name: Export Linux patch - name: Push to patches branch
run: |
mkdir -p build
godot --headless --export-release "Linux/X11" build/tekton_armageddon_patch_linux.x86_64
- name: Upload patch artifacts
uses: actions/upload-artifact@v4
with:
name: tekton-patch-${{ github.event.inputs.version }}
path: |
build/tekton_armageddon_patch_windows.exe
build/tekton_armageddon_patch_linux.x86_64
retention-days: 30
deploy-patch:
name: Deploy Patch
runs-on: ubuntu-latest
timeout-minutes: 15
needs: build-patch
permissions:
contents: write
steps:
- name: Download patch artifacts
uses: actions/download-artifact@v4
with:
name: tekton-patch-${{ github.event.inputs.version }}
path: artifacts/patch
- name: Get or create Gitea patch release
id: gitea_release
env: env:
GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }} GITEA_TOKEN: ${{ secrets.TEKTON_RELEASE_TOKEN }}
TAG_NAME: patch-${{ github.event.inputs.version }}
RELEASE_NAME: "Patch ${{ github.event.inputs.version }}"
RELEASE_NOTES: ${{ github.event.inputs.notes }}
run: | run: |
API="https://git.klud.top/api/v1/repos/danchie/tekton/releases" mkdir -p patch-deploy
RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG_NAME") cp build/patch.pck patch-deploy/
RELEASE_ID=$(echo "$RELEASE_JSON" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null) cp assets/data/version.json patch-deploy/
if [ -z "$RELEASE_ID" ]; then cd patch-deploy
PAYLOAD=$(python3 -c "import json, os; print(json.dumps({'tag_name': os.environ['TAG_NAME'], 'name': os.environ['RELEASE_NAME'], 'body': os.environ['RELEASE_NOTES'], 'prerelease': True}))") git init
RELEASE_JSON=$(curl -s -X POST \ git config user.name "god"
-H "Authorization: token $GITEA_TOKEN" \ git config user.email "god@noreply.git.klud.top"
-H "Content-Type: application/json" \ git remote add origin http://god:$GITEA_TOKEN@52.74.133.55:3000/danchie/tekton.git
-d "$PAYLOAD" \ git checkout -b patches
"$API") git add .
RELEASE_ID=$(echo "$RELEASE_JSON" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])") git commit -m "patch ${{ github.event.inputs.version }}"
fi git push -f origin patches
echo "release_id=$RELEASE_ID" >> "$GITHUB_OUTPUT"
- name: Upload Windows patch asset
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "attachment=@artifacts/patch/tekton_armageddon_patch_windows.exe" \
"https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets"
- name: Upload Linux patch asset
run: |
curl -X POST \
-H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \
-H "Content-Type: multipart/form-data" \
-F "attachment=@artifacts/patch/tekton_armageddon_patch_linux.x86_64" \
"https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets"
+1 -1
View File
@@ -26,7 +26,7 @@ PROJECT_GODOT = "project.godot"
CHANGELOG_DRAFT = "CHANGELOG_DRAFT.md" CHANGELOG_DRAFT = "CHANGELOG_DRAFT.md"
VERSION_JSON = "assets/data/version.json" VERSION_JSON = "assets/data/version.json"
EXPORT_PRESETS = "export_presets.cfg" EXPORT_PRESETS = "export_presets.cfg"
MANIFEST_URL = "https://raw.githubusercontent.com/adtpdn/tekton-updates/main/latest/patch.pck" MANIFEST_URL = "http://git.klud.top:8000/danchie/tekton/patch.pck"
# ─── Parse command line arguments ───────────────────────────────────────────── # ─── Parse command line arguments ─────────────────────────────────────────────
parser = argparse.ArgumentParser(description="Generate version.json and update version numbers") parser = argparse.ArgumentParser(description="Generate version.json and update version numbers")