Skip to content

fix: Python 必需版本降低,避免使用 3.11 版本特性 #41

fix: Python 必需版本降低,避免使用 3.11 版本特性

fix: Python 必需版本降低,避免使用 3.11 版本特性 #41

Workflow file for this run

name: Upload Python Package
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Get Version
id: version
run: |
echo "VERSION=$(pip --version)" >> $GITHUB_OUTPUT
echo "TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
echo "TAG_NAME=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Build distribution
run: |
python -m build
- name: Publish to PyPI and Release
run: |
export GH_TOKEN=$GITHUB_TOKEN
gh release upload --clobber ${{ steps.version.outputs.TAG_NAME }} dist/*.tar.gz dist/*.whl
python -m twine upload dist/* --repository-url https://upload.pypi.org/legacy/ --username __token__ --password ${{ secrets.PYPI_TOKEN }}
env:
GITHUB_TOKEN: ${{ secrets.PAT }}