43 lines
1.3 KiB
YAML
43 lines
1.3 KiB
YAML
name: Publish Python Package to Gitea
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
packages: write
|
|
|
|
jobs:
|
|
publish:
|
|
runs-on: ubuntu-latest
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
env:
|
|
PIP_BREAK_SYSTEM_PACKAGES: "1"
|
|
PATH: /usr/local/bin:/usr/local/python3.12/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
|
|
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
|
|
|
|
steps:
|
|
- uses: https://git.jc2009.com/admin/actions-checkout@v4
|
|
|
|
- name: Install build tools
|
|
run: python3.12 -m pip install --upgrade build twine --break-system-packages
|
|
|
|
- name: Build distributions
|
|
run: python3.12 -m build
|
|
|
|
- name: Publish to Gitea Package Registry
|
|
env:
|
|
TWINE_USERNAME: __token__
|
|
TWINE_PASSWORD: ${{ github.token }}
|
|
run: |
|
|
python3.12 -m twine upload \
|
|
--repository-url https://git.jc2009.com/api/packages/client-jiangchang/pypi \
|
|
dist/* |