Use Github action to upload to PyPI on new release (#1487)

This commit is contained in:
Liuyang Wan
2020-04-26 16:24:45 +08:00
committed by GitHub
parent 235fdc966d
commit fd5f013b75
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
pip install --upgrade pip
python -m pip install --upgrade pip
pip install tox tox-gh-actions
- name: Test with tox
run: tox
+24
View File
@@ -0,0 +1,24 @@
name: Publish to PyPI
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*