[pre-commit.ci] auto fixes from pre-commit.com hooks #376
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: python | |
on: [push] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9, "3.10"] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3.2.3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }} | |
restore-keys: | | |
${{ runner.os }}-pip- | |
- name: Install build tools | |
run: | | |
python -m pip install --upgrade pip | |
pip install -U black pylama wheel pip tox | |
pip install . | |
- name: Set build name | |
run: echo "::set-output name=${GITHUB_REPOSITORY}-$(python setup.py --version)" | |
- name: Lint | |
run: | | |
- name: Run Tox | |
# Run tox using the version of Python in `PATH` | |
run: tox -e py | |
- name: Build Package | |
if: matrix.python-version == 3.10 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
run: | | |
python setup.py bdist | |
- name: Publish package | |
if: matrix.python-version == 3.10 && github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.pypi_password }} |