Skip to content

add building and publishing to pypi in github actions #42

add building and publishing to pypi in github actions

add building and publishing to pypi in github actions #42

name: Test Coverage
on: ["push", "pull_request"]
jobs:
test_and_publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@master
- 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
python -m pip install poetry
python -m poetry install
- name: Run pytest
run: |
PYTHONPATH=$(pwd)
export PYTHONPATH
poetry run pytest
- name: Build
run: poetry build
- name: Publish
run: |
echo $PYPI_TOKEN
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
poetry publish