-
Notifications
You must be signed in to change notification settings - Fork 7
54 lines (51 loc) · 1.29 KB
/
publish.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
name: Publish to PyPI
on:
push:
tags:
- "v*.*.*"
jobs:
lint:
name: Run autopep8
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install test dependencies
uses: BSFishy/pip-action@v1
with:
packages: |
autopep8
isort
- name: Check code with autopep8
run: autopep8 --exit-code --diff --max-line-length 140 --recursive .
- name: Check code with isort
run: isort --profile black . --check-only
deploy:
name: Deploy to PyPI
runs-on: ubuntu-latest
needs:
- lint
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Install poetry
uses: Gr1N/setup-poetry@v8
- name: Build package
run: poetry build
- name: Publish to PyPI
run: poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
- name: Upload workflow artifact
uses: actions/upload-artifact@v3
with:
name: bk7231tools
path: |
dist/*.whl
dist/*.tar.gz