ci(publish): align with internal runner conventions (python3.12 + intra-Gitea checkout + cn mirrors)
Some checks failed
Publish Python Package to Gitea / publish (push) Failing after 31s
Some checks failed
Publish Python Package to Gitea / publish (push) Failing after 31s
This commit is contained in:
28
.github/workflows/publish.yml
vendored
28
.github/workflows/publish.yml
vendored
@@ -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/*
|
||||
Reference in New Issue
Block a user