From 3bc7b60df22bc07341d3e0b8cc7af5c2c104613c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=B5=E5=BA=94?= Date: Sun, 12 Jul 2026 02:24:24 +0800 Subject: [PATCH] ci: fix runner-3 --- .gitea/workflows/fix-r3.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .gitea/workflows/fix-r3.yml diff --git a/.gitea/workflows/fix-r3.yml b/.gitea/workflows/fix-r3.yml new file mode 100644 index 000000000..451cfcc07 --- /dev/null +++ b/.gitea/workflows/fix-r3.yml @@ -0,0 +1,44 @@ +name: Fix Runner 3 +on: + push: + branches: + - ci/runner-fix + +jobs: + fix: + runs-on: runtime-builder + steps: + - name: fix r3 + run: | + set -ex + CI_DIR="/var/lib/xiaoxia-ci" + ACT_BIN="$CI_DIR/act_runner" + GITEA_URL="https://git.xiaoxiajianji.com" + LABELS="saas,runtime-builder,host,ubuntu-latest" + TOKEN="1f8058d097e3942a9ed31c44382baf7f08311272" + + echo "=== runner-3 status ===" + systemctl status act_runner-3.service 2>&1 | head -15 || true + + echo "" + echo "=== runner-3 .runner file ===" + ls -la "$CI_DIR/runner-3/" || true + cat "$CI_DIR/runner-3/.runner" 2>/dev/null | head -5 || echo "no .runner file" + + echo "" + echo "=== Re-registering runner-3 ===" + REG_TOKEN=$(curl -sk -X POST -H "Authorization: token $TOKEN" "$GITEA_URL/api/v1/repos/xiaoxia/xiaoxia-saas/actions/runners/registration-token" | python3 -c "import sys,json; print(json.load(sys.stdin).get('token',''))") + echo "token len: ${#REG_TOKEN}" + + systemctl stop act_runner-3.service 2>&1 || true + sleep 2 + cd "$CI_DIR/runner-3" + rm -f .runner + $ACT_BIN register --instance "$GITEA_URL" --token "$REG_TOKEN" --name "xiaoxia-ci-runner-3" --labels "$LABELS" --no-interactive + systemctl start act_runner-3.service + + sleep 15 + echo "" + echo "=== Final ===" + curl -sk -H "Authorization: token $TOKEN" "$GITEA_URL/api/v1/repos/xiaoxia/xiaoxia-saas/actions/runners?limit=50" > /tmp/r.json + python3 -c "import sys,json;d=json.load(open('/tmp/r.json'));online=[r for r in d['runners'] if r['status']=='online'];print(f'online: {len(online)}');[print(f' {r[\"name\"]}: {[l[\"name\"] for l in r[\"labels\"]]}') for r in online]"