Skip to content

Commit

Permalink
Add PyPI deploy job
Browse files Browse the repository at this point in the history
  • Loading branch information
nocarryr committed Mar 31, 2021
1 parent 53da924 commit abf3c4b
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/wheel-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ on:
branches: [ main ]
pull_request:
branches: [ main ]
release:
types: [created]

jobs:
build:
Expand Down Expand Up @@ -61,3 +63,28 @@ jobs:
pip install dist/*.tar.gz
- name: Test built sdist
run: py.test

deploy:
needs: test
if: ${{ success() && github.event_name == "release" }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel twine
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: 'dists'
path: dist
- name: Publish to PyPI
env:
TWINE_REPOSITORY_URL: ${{ secrets.TWINE_REPOSITORY_URL }}
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: twine upload dist/*

0 comments on commit abf3c4b

Please sign in to comment.