Skip to content

Merge pull request #77 from causalincentives/fixtypes #24

Merge pull request #77 from causalincentives/fixtypes

Merge pull request #77 from causalincentives/fixtypes #24

Workflow file for this run

# Publish releases to PyPI
name: Publish to PyPI
on:
push:
tags:
- 'v*.*.*'
jobs:
build-and-publish:
if: github.event.base_ref == 'refs/heads/master'
name: Build and publish to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: python -m pip install --upgrade pip build flake8 mypy pytest black
- name: Check code style with Flake8
run: python -m flake8 .
- name: Check formatting with Black
run: python -m black --check .
- name: Check typing with Mypy
run: python -m mypy .
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Install the built package
run: python -m pip install "$(ls dist/*.whl)"[test]
- name: Run tests on the package
run: pytest
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}