From 03028413cac4064f8ef6caec98a9a0c05fa3ce46 Mon Sep 17 00:00:00 2001 From: adtpdn Date: Fri, 3 Jul 2026 13:25:27 +0800 Subject: [PATCH] chore(ci): only tag release + patch, no testing, cp from /cache --- .gitea/workflows/ci.yml | 109 ++++++++++++------------------ .gitea/workflows/deploy_patch.yml | 21 ++++-- 2 files changed, 61 insertions(+), 69 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 9e3a742..842fe25 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -1,68 +1,49 @@ -name: CI +name: Release on: push: - branches: [main, experimental, patch-release] - pull_request: - branches: [main, experimental, patch-release] + tags: + - 'v*' jobs: export-windows: name: Export Windows runs-on: ubuntu-latest - env: - ACTIONS_STEP_DEBUG: true timeout-minutes: 45 steps: - name: Setup SSH config for Gitea run: | echo -e "Host gitea\n HostName 100.79.174.108\n Port 222\n StrictHostKeyChecking no" >> /etc/ssh/ssh_config - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - fetch-depth: 0 ssh-key: ${{ secrets.TEKTON_SSH_KEY }} ssh-strict: false - - name: Setup Godot from shared cache + - name: Setup Godot run: | - set -e - GODOT_SRC="/home/dev/godot-cache/Godot_v4.6-stable_linux.x86_64.zip" - if [ -f "$GODOT_SRC" ]; then - cp -a "$GODOT_SRC" ./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 + cp /cache/Godot_v4.6-stable_linux.x86_64.zip ./godot.zip 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 from shared cache + - name: Install export templates run: | - set -euo pipefail mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable - TPL_SRC="/home/dev/godot-cache/Godot_v4.6-stable_export_templates.tpz" - if [ -f "$TPL_SRC" ]; then - cp -a "$TPL_SRC" /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 + cp /cache/Godot_v4.6-stable_export_templates.tpz /tmp/godot-templates.tpz 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/ 2>/dev/null || true + 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/ 2>/dev/null || true + cp -a /tmp/godot-templates/* ~/.local/share/godot/export_templates/4.6.stable/ fi - find ~/.local/share/godot/export_templates/4.6.stable -maxdepth 1 -type f | sed -n '1,20p' || true - name: Export Windows run: | mkdir -p build godot --headless --export-release "Windows Desktop" build/tekton_armageddon_windows.exe - - name: Upload Windows artifact - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v4 with: name: tekton-windows path: build/tekton_armageddon_windows.exe @@ -77,53 +58,46 @@ jobs: run: | echo -e "Host gitea\n HostName 100.79.174.108\n Port 222\n StrictHostKeyChecking no" >> /etc/ssh/ssh_config - - name: Checkout repository - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: ssh-key: ${{ secrets.TEKTON_SSH_KEY }} ssh-strict: false - - name: Setup Godot from shared cache + - name: Setup Godot run: | - set -e - GODOT_SRC="/home/dev/godot-cache/Godot_v4.6-stable_linux.x86_64.zip" - if [ -f "$GODOT_SRC" ]; then - cp -a "$GODOT_SRC" ./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 + cp /cache/Godot_v4.6-stable_linux.x86_64.zip ./godot.zip 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 from shared cache + - name: Install export templates run: | - set -euo pipefail mkdir -v -p ~/.local/share/godot/export_templates/4.6.stable - TPL_SRC="/home/dev/godot-cache/Godot_v4.6-stable_export_templates.tpz" - if [ -f "$TPL_SRC" ]; then - cp -a "$TPL_SRC" /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 + cp /cache/Godot_v4.6-stable_export_templates.tpz /tmp/godot-templates.tpz 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/ 2>/dev/null || true + 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/ 2>/dev/null || true + cp -a /tmp/godot-templates/* ~/.local/share/godot/export_templates/4.6.stable/ fi - find ~/.local/share/godot/export_templates/4.6.stable -maxdepth 1 -type f | sed -n '1,20p' || true - name: Export Linux run: | mkdir -p build godot --headless --export-release "Linux/X11" build/tekton_armageddon_linux.x86_64 - - name: Upload Linux artifact - uses: actions/upload-artifact@v4 + - name: Build PCK + run: | + godot --headless -s tools/build_patch.gd + mkdir -p build + mv patch.pck build/tekton_armageddon.pck 2>/dev/null || true + + - uses: actions/upload-artifact@v4 with: name: tekton-linux - path: build/tekton_armageddon_linux.x86_64 + path: | + build/tekton_armageddon_linux.x86_64 + build/tekton_armageddon.pck retention-days: 7 release: @@ -131,21 +105,18 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 needs: [export-windows, export-linux] - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') permissions: contents: write steps: - - name: Download Windows artifact - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: tekton-windows - path: artifacts/windows + path: artifacts - - name: Download Linux artifact - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v4 with: name: tekton-linux - path: artifacts/linux + path: artifacts - name: Get or create Gitea release id: gitea_release @@ -154,11 +125,11 @@ jobs: TAG_NAME: ${{ github.ref_name }} run: | API="https://git.klud.top/api/v1/repos/danchie/tekton/releases" - RELEASE_JSON=$(curl -s -H "Authorization: token ***" "$API/tags/$TAG_NAME") + RELEASE_JSON=$(curl -s -H "Authorization: token $GITEA_TOKEN" "$API/tags/$TAG_NAME") RELEASE_ID=$(echo "$RELEASE_JSON" | grep -o '"id":[0-9]*' | head -1 | grep -o '[0-9]*') if [ -z "$RELEASE_ID" ]; then RELEASE_JSON=$(curl -s -X POST \ - -H "Authorization: token ***" \ + -H "Authorization: token $GITEA_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"tag_name\": \"$TAG_NAME\", \"name\": \"$TAG_NAME\"}" \ "$API") @@ -171,7 +142,7 @@ jobs: curl -X POST \ -H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \ -H "Content-Type: multipart/form-data" \ - -F "attachment=@artifacts/windows/tekton_armageddon_windows.exe" \ + -F "attachment=@artifacts/tekton_armageddon_windows.exe" \ "https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets" - name: Upload Linux asset @@ -179,5 +150,13 @@ jobs: curl -X POST \ -H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \ -H "Content-Type: multipart/form-data" \ - -F "attachment=@artifacts/linux/tekton_armageddon_linux.x86_64" \ + -F "attachment=@artifacts/tekton_armageddon_linux.x86_64" \ + "https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets" + + - name: Upload PCK asset + run: | + curl -X POST \ + -H "Authorization: token ${{ secrets.TEKTON_RELEASE_TOKEN }}" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@artifacts/tekton_armageddon.pck" \ "https://git.klud.top/api/v1/repos/danchie/tekton/releases/${{ steps.gitea_release.outputs.release_id }}/assets" diff --git a/.gitea/workflows/deploy_patch.yml b/.gitea/workflows/deploy_patch.yml index 7870fc8..3244a19 100644 --- a/.gitea/workflows/deploy_patch.yml +++ b/.gitea/workflows/deploy_patch.yml @@ -46,16 +46,29 @@ jobs: - name: Setup Godot run: | - wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_linux.x86_64.zip - unzip -q Godot_v4.6-stable_linux.x86_64.zip + 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 - wget -q https://github.com/godotengine/godot-builds/releases/download/4.6-stable/Godot_v4.6-stable_export_templates.tpz - unzip -q Godot_v4.6-stable_export_templates.tpz -d ~/.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: