Skip to content

Add tests (#2)

Add tests (#2) #5

name: build and publish
permissions:
id-token: write
on:
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
env:
TERM: xterm-256color
jobs:
build-and-publish:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Build
run: make build
env:
PYTHON_VERSION: ${{ matrix.python-version }}
- name: Test
run: make test
env:
PYTHON_VERSION: ${{ matrix.python-version }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to PyPI
if: matrix.python-version == '3.12' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1