on: push: pull_request: jobs: build: name: build runs-on: ubuntu-latest strategy: matrix: python: - "3.7" - "3.8" - "3.9" - "3.10" - "3.11" steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - run: python -m pip install -U pip - run: python -m pip install setuptools wheel - run: python -m pip install flake8 twine - run: python setup.py sdist bdist_wheel - run: python -m pip install dist/*.whl - run: twine check dist/* - run: flake8 - name: Publish PyPI package if: startsWith(github.ref, 'refs/tags/v') && matrix.python == '3.11' env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} run: twine upload dist/*.whl dist/*.tar.gz