-
Notifications
You must be signed in to change notification settings - Fork 7
47 lines (42 loc) · 1.22 KB
/
main.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
name: Main workflow
on: [push, pull_request]
jobs:
tests:
name: Tests & Checks
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{matrix.python}}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Check with linters
run: tox -e lint
- name: Test with tox
run: tox -e py
build:
name: Build and upload release to Pypi
runs-on: ubuntu-latest
needs: tests
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
# deploy only when a new tag is pushed to github
- name: Publish package distributions to PyPI
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}