Skip to content

Workflow file for this run

name: Run tests & Publish Python 🐍 distributions πŸ“¦ to PyPI
on:
push:
tags:
- '*'
jobs:
tests-ci:
strategy:
fail-fast: false
matrix:
# you have to quote any version number ending in a 0 or gh truncates it. ie 3.10 turned into 3.1
python-version: [ 3.8, '3.10' ]
os: [ ubuntu-latest ] #in the future we should add windows here
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: pip install
run: |
pip install -r requirements/requirements.txt
pip install -r requirements/requirements_test.txt
- name: run tests
run: pytest .
build-n-publish:
name: Build the 🐍 package and push PyPI
runs-on: ubuntu-latest
needs: tests-ci
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: '3.10'
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution πŸ“¦ to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}