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 :
2024-06-18 16:20:50 +08:00
branches :
- master
2024-03-29 22:15:57 +08:00
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
2024-06-18 16:41:46 +08:00
make init
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 }}
2024-06-18 16:41:46 +08:00
2024-03-29 22:15:57 +08:00
run : |
python setup.py sdist bdist_wheel
2024-06-18 16:27:32 +08:00
twine upload dist/*
twine upload dist/* --repository https://git.moyanjdc.top/api/packages/moyan/pypi/simple