🔧 chore(workflow): require Python 3.11 in runners

This commit is contained in:
csh
2026-08-12 08:34:19 +08:00
parent 7cb8b130bb
commit a71480a4ae
4 changed files with 17 additions and 11 deletions
@@ -129,6 +129,9 @@ jobs:
run: |
set -euo pipefail
cd "$REPO_DIR"
PYTHON_BIN="${PYTHON_BIN:-$(command -v python3.11 || command -v python3)}"
"$PYTHON_BIN" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else "Python 3.11 or newer is required")'
export PYTHON_BIN
echo "========================================"
echo "📦 Refresh thirdparty/skill snapshots"
@@ -216,7 +219,7 @@ jobs:
}
emit_sources_tsv() {
python3 - "$MANIFEST_PATH" <<'PY'
"$PYTHON_BIN" - "$MANIFEST_PATH" <<'PY'
import json
import sys
@@ -419,9 +422,11 @@ jobs:
THIRDPARTY_BRANCH="${THIRDPARTY_BRANCH:-thirdparty/skill}"
TARGET_BRANCH="${TARGET_BRANCH:-main}"
MANIFEST_PATH="${MANIFEST_PATH:-.gitea/ci/thirdparty_skills.json}"
PYTHON_BIN="${PYTHON_BIN:-$(command -v python3.11 || command -v python3)}"
"$PYTHON_BIN" -c 'import sys; raise SystemExit(0 if sys.version_info >= (3, 11) else "Python 3.11 or newer is required")'
emit_sources_tsv() {
python3 - "$MANIFEST_PATH" <<'PY'
"$PYTHON_BIN" - "$MANIFEST_PATH" <<'PY'
import json
import sys
@@ -464,7 +469,7 @@ jobs:
local data_dir_rel="$5"
local scripts_dir_rel="$6"
python3 - "$snapshot_root" "$output_dir" "$platform_config_rel" "$template_root_rel" "$data_dir_rel" "$scripts_dir_rel" <<'PY'
"$PYTHON_BIN" - "$snapshot_root" "$output_dir" "$platform_config_rel" "$template_root_rel" "$data_dir_rel" "$scripts_dir_rel" <<'PY'
import json
import pathlib
import shutil
@@ -566,7 +571,7 @@ jobs:
local output_dir="$2"
local include_paths="$3"
python3 - "$snapshot_root" "$output_dir" "$include_paths" <<'PY'
"$PYTHON_BIN" - "$snapshot_root" "$output_dir" "$include_paths" <<'PY'
import os
import pathlib
import shutil