Skip to content

Merge pull request #140 from xambroz/patch-1 #91

Merge pull request #140 from xambroz/patch-1

Merge pull request #140 from xambroz/patch-1 #91

Workflow file for this run

name: build
on: push
jobs:
test:
name: Test Python ${{ matrix.python-version }} (${{ matrix.os }})
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: make setup
- name: Lint
run: make lint
- name: Run tests
run: make test
release:
name: Release
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install requirements
run: python -m pip install wheel setuptools build
- name: Build a distribution
run: python -m build
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}