From 71735cc31e0e8fcdda89a088e9260d0183fee48b Mon Sep 17 00:00:00 2001 From: Adrian Bonpin Date: Tue, 1 Sep 2026 11:41:57 +0800 Subject: [PATCH] ci: extract release id with grep instead of python The Windows runner's act_runner service env still lacks python/python3, so the release-upload step failed to parse JSON. Use grep to pull the release id, removing the Python dependency from both upload steps. --- .gitea/workflows/release.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 458e18e..a8c01bb 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -137,17 +137,16 @@ jobs: set -euo pipefail API="${GITEA_SERVER}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}" AUTH="Authorization: token ${GITHUB_TOKEN}" - PY="python3"; command -v python3 >/dev/null 2>&1 || PY="python" # Ensure the release exists (idempotent — both jobs may call this). REL_ID=$(curl -fsS -H "$AUTH" "${API}/releases/tags/${TAG}" \ - | $PY -c "import sys,json;print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true) + | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true) if [ -z "$REL_ID" ]; then BODY="Gridline ${TAG#v} — Linux and Windows installers." REL_ID=$(curl -fsS -X POST -H "$AUTH" -H "Content-Type: application/json" \ -d "{\"tag_name\":\"${TAG}\",\"name\":\"Gridline ${TAG#v}\",\"body\":\"${BODY}\",\"draft\":true}" \ "${API}/releases" \ - | $PY -c "import sys,json;print(json.load(sys.stdin)['id'])") + | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) fi BUNDLE="${GITHUB_WORKSPACE}/desktop/src-tauri/target/release/bundle" @@ -250,16 +249,15 @@ jobs: set -euo pipefail API="${GITEA_SERVER}/api/v1/repos/${REPO_OWNER}/${REPO_NAME}" AUTH="Authorization: token ${GITHUB_TOKEN}" - PY="python3"; command -v python3 >/dev/null 2>&1 || PY="python" REL_ID=$(curl -fsS -H "$AUTH" "${API}/releases/tags/${TAG}" \ - | $PY -c "import sys,json;print(json.load(sys.stdin).get('id',''))" 2>/dev/null || true) + | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2 || true) if [ -z "$REL_ID" ]; then BODY="Gridline ${TAG#v} — Linux and Windows installers." REL_ID=$(curl -fsS -X POST -H "$AUTH" -H "Content-Type: application/json" \ -d "{\"tag_name\":\"${TAG}\",\"name\":\"Gridline ${TAG#v}\",\"body\":\"${BODY}\",\"draft\":true}" \ "${API}/releases" \ - | $PY -c "import sys,json;print(json.load(sys.stdin)['id'])") + | grep -o '"id":[0-9]*' | head -1 | cut -d: -f2) fi BUNDLE="${GITHUB_WORKSPACE}/desktop/src-tauri/target/release/bundle"