-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (42 loc) · 1.35 KB
/
python.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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 }}