PagerMaid-Modify/.github/workflows/python.yml

48 lines
1.1 KiB
YAML
Raw Permalink Normal View History

name: Upload Python Package
on:
# 当master分支有push时触发action
2020-08-11 14:15:47 +00:00
#push:
#branches:
#- master
# 当一个pr被合并到master时触发action
2020-08-11 14:15:47 +00:00
#pull_request:
#branches:
#- master
# 当发布时触发action
2020-08-11 14:15:47 +00:00
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
2020-08-11 14:15:47 +00:00
python-version: ["3.6"]
steps:
# 此步骤使用 GitHub 的 https://github.com/actions/checkout
- uses: actions/checkout@v2
# 设置python环境
# 此步骤使用 GitHub 的 https://github.com/actions/setup-python
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
2020-08-11 12:52:45 +00:00
with:
python-version: ${{ matrix.python-version }}
2020-08-11 14:15:47 +00:00
# 安装依赖
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
# 构建和发布
- 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/*