Skip to content

Commit 9ca4506

Browse files
committed
Publish distribution to PyPI on GitHub Actions
1 parent 033f873 commit 9ca4506

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

.github/workflows/build.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,21 @@ jobs:
6969
run: |
7070
pip install codecov
7171
codecov
72+
publish:
73+
runs-on: ubuntu-latest
74+
needs: [lint, test]
75+
steps:
76+
- uses: actions/checkout@v2
77+
- name: Set up Python
78+
uses: actions/setup-python@v2
79+
with:
80+
python-version: '3.9'
81+
- name: Install dependencies
82+
run: python -m pip install --upgrade pip setuptools wheel build
83+
- name: Build a binary wheel and a source tarball
84+
run: python -m build --sdist --wheel --outdir dist/ .
85+
- name: Publish distribution to PyPI
86+
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') }}
87+
uses: pypa/gh-action-pypi-publish@master
88+
with:
89+
password: ${{ secrets.PYPI_API_TOKEN }}

0 commit comments

Comments
 (0)