2024-03-29 22:15:57 +08:00
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# action的名称
2024-03-30 10:56:51 +08:00
name : Upload Python Package
2024-03-29 22:15:57 +08:00
on :
# 当master分支有push时, 触发action
push :
jobs :
deploy :
name : publish python package to PYPI
# 此作业在 Linux 上运行
runs-on : ubuntu-latest
steps :
# 此步骤使用 GitHub 的 https://github.com/actions/checkout
- uses : actions/checkout@v2
# 安装依赖
- name : Install dependencies
run : |
python -m pip install --upgrade pip
python -m pip install wheel twine
python -m pip install -r requirements.txt
2024-03-30 10:56:51 +08:00
2024-03-29 22:15:57 +08:00
# - name: Test Code
# run: |
# ./test.sh
# 构建和发布
- name : Build and publish
env :
TWINE_USERNAME : ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD : ${{ secrets.PYPI_PASSWORD }}
run : |
python setup.py sdist bdist_wheel
twine upload dist/*