Skip to content

Commit 88ed86e

Browse files
ci: added pypi publish jobs
1 parent 7dacbb4 commit 88ed86e

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

.github/workflows/python-publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish Python Package
2+
on:
3+
release:
4+
types: [published]
5+
permissions:
6+
contents: read
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
- name: Set up Python
13+
uses: actions/setup-python@v3
14+
with:
15+
python-version: '3.11'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install build
20+
- name: Build package
21+
run: python -m build
22+
- name: Publish package
23+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
24+
with:
25+
user: __token__
26+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/python-test.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Python Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
max-parallel: 4
13+
matrix:
14+
python-version: [3.11]
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r requirements.txt
25+
- name: Lint with flake8
26+
run: |
27+
pip install flake8
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+
# - name: Test with pytest
33+
# run: |
34+
# pip install pytest
35+
# pytest

0 commit comments

Comments
 (0)