Files
tekton/.gitea/workflows/deploy_patch.yml
T
adtpdn 03028413ca
Test Suite / Unit Tests (GUT) (push) Successful in 46s
Release / Export Windows (push) Failing after 45s
Release / Export Linux (push) Failing after 16s
Release / Create Release (push) Has been skipped
Upload PCK to Gitea Release / upload (push) Failing after 47s
Test Suite / Security Scan (push) Failing after 13m23s
Test Suite / Code Style Check (push) Failing after 13m41s
Test Suite / Integration Tests (push) Failing after 14m26s
Build and Upload Binaries / build (push) Failing after 17m44s
chore(ci): only tag release + patch, no testing, cp from /cache
2026-07-03 13:25:27 +08:00

149 lines
5.9 KiB
YAML

name: Deploy Patch
on:
workflow_dispatch:
inputs:
version:
description: 'Patch version (e.g., 2.4.2)'
required: true
type: string
notes:
description: 'Release notes'
required: false
type: string
jobs:
build-patch:
name: Build Patch
runs-on: ubuntu-latest
timeout-minutes: 45
env:
ACTIONS_STEP_DEBUG: true
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
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.TEKTON_SSH_KEY }}
ssh-strict: false
- name: Setup Godot
run: |
if [ -f /cache/Godot_v4.6-stable_linux.x86_64.zip ]; then
cp -a /cache/Godot_v4.6-stable_linux.x86_64.zip godot.zip
else
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
- name: Install export templates
run: |
mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable
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
if [ -d /tmp/godot-templates/templates ]; then
cp -a /tmp/godot-templates/templates/* ~/.local/share/godot/export_templates/4.6.stable/
else
cp -a /tmp/godot-templates/* ~/.local/share/godot/export_templates/4.6.stable/
fi
- name: Run patch build script
env:
PATCH_VERSION: ${{ github.event.inputs.version }}
PATCH_NOTES: ${{ github.event.inputs.notes }}
run: |
python3 patch_version.py "$PATCH_VERSION" "$PATCH_NOTES"
- name: Export Windows patch
run: |
mkdir -p build
godot --headless --export-release "Windows Desktop" build/tekton_armageddon_patch_windows.exe
- name: Export Linux patch
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:
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: |
API="https://git.klud.top/api/v1/repos/danchie/tekton/releases"
RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG_NAME")
RELEASE_ID=$(echo "$RELEASE_JSON" | python3 -c "import json,sys; print(json.load(sys.stdin).get('id',''))" 2>/dev/null)
if [ -z "$RELEASE_ID" ]; then
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}))")
RELEASE_JSON=$(curl -s -X POST \
-H "Authorization: token $GITEA_TOKEN" \
-H "Content-Type: application/json" \
-d "$PAYLOAD" \
"$API")
RELEASE_ID=$(echo "$RELEASE_JSON" | python3 -c "import json,sys; print(json.load(sys.stdin)['id'])")
fi
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"