-
Notifications
You must be signed in to change notification settings - Fork 12
76 lines (61 loc) · 1.5 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Test k5test
on:
push:
branches:
- main
paths-ignore:
- CODE_OF_CONDUCT.md
- K5TEST-LICENSE.txt
- LICENSE.txt
- README.md
pull_request:
branches:
- main
paths-ignore:
- CODE_OF_CONDUCT.md
- K5TEST-LICENSE.txt
- LICENSE.txt
- README.md
release:
types:
- published
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test
run: |
echo "::group::Installing Python Requirements"
python -m pip install --upgrade pip setuptools wheel
python -m pip install --requirement requirements-dev.txt
python -m pip install .
echo "::endgroup::"
echo "::group::Running Sanity Checks"
python -m black . --check
python -m isort . --check-only
echo "::endgroup::"
publish:
name: publish
needs:
- test
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- name: Build sdist and wheel
run: |
python -m pip install --upgrade pip setuptools wheel
python setup.py bdist_wheel --universal
python setup.py sdist
- name: Capture sdist and wheel
uses: actions/upload-artifact@v3
with:
name: k5test
path: dist/*
- name: Publish
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@release/v1