Skip to content

Commit

Permalink
add build and push to pypi in ci workflow (#241)
Browse files Browse the repository at this point in the history
* add build and push to pypi in ci workflow

* install wheel package

* run jobs sequentially

* remove test publish to test.pypi.org/legacy
  • Loading branch information
mdmurbach authored Jan 28, 2023
1 parent 9dbca09 commit b183863
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI tests
name: Run tests and build package
on:
pull_request:
push:
Expand Down Expand Up @@ -31,11 +31,12 @@ jobs:
tests:
name: Run tests
needs: linting
runs-on: ubuntu-latest

strategy:
fail-fast: false
max-parallel: 4
max-parallel: 5
matrix:
python-version: [3.7, 3.8, 3.9, 3.10, 3.11]

Expand All @@ -62,3 +63,27 @@ jobs:
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-and-push:
name: Build and publish package to PyPI
needs: [linting, tests]
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master

- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"

- name: Build a binary wheel and a source tarball
run: |
python3 -m pip install wheel
python3 setup.py sdist bdist_wheel
- name: Publish distribution to PyPI (if tagged)
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}

0 comments on commit b183863

Please sign in to comment.