PagerMaid-Modify/.github/workflows/python.yml
2020-08-11 20:52:45 +08:00

47 lines
1.2 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Upload Python Package
on:
# 当master分支有push时触发action
push:
branches:
- master
# 当一个pr被合并到master时触发action
pull_request:
branches:
- master
# 当发布时触发action
#release:
# types: [created]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.6", "3.7", "3.8"]
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
with:
python-version: ${{ matrix.python-version }}
# 安装依赖
- 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/*