Skip to content

Commit eb68d7c

Browse files
committed
add publish workflow
1 parent 138e0f1 commit eb68d7c

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Python package
2+
3+
on:
4+
push:
5+
paths:
6+
- filebrowser/__init__.py
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
13+
- uses: actions/checkout@v2
14+
15+
- name: Set up Python
16+
run: |
17+
sudo apt update
18+
sudo apt install python3 python3-pip -y
19+
python -m pip install --upgrade pip
20+
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install -r requirements.txt
24+
pip install setuptools wheel twine flake8
25+
26+
- name: Lint with flake8
27+
run: |
28+
# stop the build if there are Python syntax errors or undefined names
29+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
30+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
31+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
32+
33+
- name: Build and publish
34+
env:
35+
TWINE_USERNAME: __token__
36+
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
37+
run: |
38+
python setup.py sdist bdist_wheel
39+
twine upload dist/*

0 commit comments

Comments
 (0)