-
Notifications
You must be signed in to change notification settings - Fork 29
51 lines (51 loc) · 1.35 KB
/
ci.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
51
name: ci
on:
push:
jobs:
test:
name: Run tests and build distribution
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
pip install tox wheel setuptools
- name: Run lint
run: >-
tox -e lint
- name: Run tests
run: >-
tox -e py
build-and-publish:
name: Build and optionally publish a distribution
runs-on: ubuntu-latest
needs: test # the test job must have been successful
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Dependencies
run: |
pip install wheel setuptools
- name: Build distribution
run: >-
make dist
- name: Publish distribution package to PyPI (on tags starting with v)
if: startsWith(github.event.ref, 'refs/tags/v')
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
TWINE_REPOSITORY_URL: https://upload.pypi.org/legacy/
run: >-
pip install twine && twine upload dist/*