添加自动发布到pypi的github action

This commit is contained in:
xaoyo 2023-10-28 20:29:33 +08:00
parent 20ba8a2be6
commit 72be0ce958

View File

@ -24,18 +24,13 @@ jobs:
with: with:
python-version: 3.8 # 指定 Python 版本 (3.8) python-version: 3.8 # 指定 Python 版本 (3.8)
- name: Install dependencies # 安装依赖 - name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools
python -m pip install -U wheel
python -m pip install -U twine
# pip install .
- name: Build package # 构建包
run: | run: |
cat setup.py python -m pip install --upgrade pip
python setup.py sdist bdist_wheel # 构建 wheel 和 sdist 包 pip install build
- name: Build package
run: python -m build
- name: Publish package - name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1 # 使用 PyPA 的 action uses: pypa/gh-action-pypi-publish@release/v1 # 使用 PyPA 的 action