-
Notifications
You must be signed in to change notification settings - Fork 3
68 lines (64 loc) · 1.83 KB
/
ci.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
63
64
65
66
67
68
name: ci
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Run Unit Test
run: |
cd python
tox -e unit
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Run Link
run: |
cd python
tox -e format
release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Setup Go Environment
uses: actions/setup-go@v3
with:
go-version: '>=1.20.0'
- name: Upload
run: |
mkdir -p build/
cd python && python setup.py sdist
go get github.com/tcnksm/ghr
ghr -r ${{ github.event.repository.name }} -t ${{ secrets.GITHUB_TOKEN }} -replace -draft ${{ TAG_NAME }} build/
pypi:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
needs: [test, lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox tox-gh-actions
- name: Publish
env:
TWINE_USERNAME: vaporio
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
cd python
tox -e publish