From ebdd8b562d295b581b22d2b401af655c20ed583d Mon Sep 17 00:00:00 2001 From: chendelian <116870791@qq.com> Date: Wed, 6 May 2026 17:28:13 +0800 Subject: [PATCH] ci(publish): align with internal runner conventions (python3.12 + intra-Gitea checkout + cn mirrors) --- .github/workflows/publish.yml | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7deecda..11160a9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,25 +9,33 @@ on: jobs: publish: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + defaults: + run: + shell: bash + env: + PIP_BREAK_SYSTEM_PACKAGES: "1" + # 显式 PATH,匹配宿主机自建的 python3.12 + PATH: /usr/local/bin:/usr/local/python3.12/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin + # 国内镜像,避免 pypi.org 超时 + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple + PIP_EXTRA_INDEX_URL: https://mirrors.aliyun.com/pypi/simple https://mirrors.cloud.tencent.com/pypi/simple https://mirrors.huaweicloud.com/repository/pypi/simple + PIP_DEFAULT_TIMEOUT: "180" + PIP_TRUSTED_HOST: pypi.tuna.tsinghua.edu.cn mirrors.aliyun.com mirrors.cloud.tencent.com mirrors.huaweicloud.com files.pythonhosted.org pypi.org - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' + steps: + - uses: https://git.jc2009.com/admin/actions-checkout@v4 - name: Install build tools - run: pip install --upgrade build twine + run: python3.12 -m pip install --upgrade build twine --break-system-packages - name: Build distributions - run: python -m build + run: python3.12 -m build - name: Publish to Gitea Package Registry env: TWINE_USERNAME: ${{ secrets.GITEA_USERNAME }} TWINE_PASSWORD: ${{ secrets.GITEA_TOKEN }} run: | - twine upload \ + python3.12 -m twine upload \ --repository-url https://git.jc2009.com/api/packages/client-jiangchang/pypi \ - dist/* + dist/* \ No newline at end of file