forked from marshmallow-code/webargs
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (58 loc) · 1.75 KB
/
build.yaml
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
52
53
54
55
56
57
58
59
60
61
62
name: build
on:
push:
pull_request:
schedule: # nightly build
- cron: '0 0 * * *'
jobs:
mypy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: python -m pip install tox
- run: python -m tox -e mypy
test:
strategy:
matrix:
tox-factor: [""]
python-version: ["3.7", "3.11"]
include:
- python-version: "3.11"
tox-factor: "-marshmallowdev"
- python-version: "3.7"
tox-factor: "-mindeps"
name: "test py${{ matrix.python-version }}${{ matrix.tox-factor }}"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: python -m pip install tox
- run: python -m tox -e py${{ matrix.tox-factor }}
# this duplicates pre-commit.ci, so only run it on tags
# it guarantees that linting is passing prior to a release
lint-pre-release:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- run: python -m pip install tox
- run: python -m tox -e lint
release:
needs: [mypy, test, lint-pre-release]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: install requirements
run: python -m pip install build twine
- name: build dists
run: python -m build
- name: check package metadata
run: twine check dist/*
- name: publish
run: twine upload -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} dist/*