-
Notifications
You must be signed in to change notification settings - Fork 73
50 lines (50 loc) · 1.42 KB
/
build-release.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
47
48
49
50
name: build
on:
push:
pull_request:
jobs:
lint:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: '3.11'
- run: python -m pip install --upgrade pip wheel
- run: pip install tox
- run: tox -elint
tests:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- {name: '3.8-mindeps', python: '3.8', tox: py38-mindeps}
- {name: '3.8', python: '3.8', tox: py38}
- {name: '3.11', python: '3.11', tox: py311}
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
- name: Run test
run: |
python -m pip install --upgrade pip wheel
pip install tox
tox -e${{ matrix.tox }}
- name: Upload coverage
uses: codecov/codecov-action@v3
release:
needs: [lint, tests]
name: PyPI release
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
- run: python -m pip install --upgrade pip wheel
- run: pip install twine
- run: python setup.py sdist bdist_wheel
- run: twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*