From 0459c093f3d0c9006d6084bb83e0181669c15d22 Mon Sep 17 00:00:00 2001 From: Hongru Date: Tue, 1 Sep 2026 01:08:38 +0800 Subject: [PATCH] =?UTF-8?q?patch:=20=E7=A6=BB=E7=BA=BF=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2=20setup-python=20=E4=B8=BA=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=20toolcache=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- action.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 4f8ff679..4708531a 100644 --- a/action.yml +++ b/action.yml @@ -24,12 +24,19 @@ branding: runs: using: composite steps: - # Set up the version of Python that supports pyodide - - uses: actions/setup-python@v5 - id: python - with: - python-version: "3.12" - update-environment: false + # PATCHED for self-hosted runner (offline): 原 actions/setup-python@v5 需联网校验 + # versions manifest,内网不可达;直接使用 toolcache 预置的 Python 3.12 + - id: python + run: | + for p in /opt/hostedtoolcache/Python/3.12*/x64/bin/python3.12 /usr/bin/python3.12 /usr/bin/python3; do + if [ -x "$p" ]; then + echo "python-path=$p" >> "$GITHUB_OUTPUT" + exit 0 + fi + done + echo "no usable python found" >&2 + exit 1 + shell: bash - id: cibw run: |