Skip to content

Commit c8c7262

Browse files
Release on PyPI (#2)
1 parent 50618be commit c8c7262

32 files changed

+1780
-379
lines changed

.github/workflows/main.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
name: Build and Test
8+
9+
runs-on: ubuntu-latest
10+
strategy:
11+
max-parallel: 4
12+
matrix:
13+
python-version: [3.6, 3.7, 3.8]
14+
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: Build and install
22+
run: |
23+
pip install .
24+
- name: Build distributions
25+
run: |
26+
pip install setuptools wheel
27+
python setup.py sdist bdist_wheel
28+
29+
lint:
30+
name: Lint and Autoformat
31+
32+
runs-on: ubuntu-latest
33+
34+
steps:
35+
- uses: actions/checkout@master
36+
with:
37+
ref: ${{ github.ref }}
38+
- name: Set up Python
39+
uses: actions/setup-python@v1
40+
with:
41+
python-version: 3.8
42+
- name: Black Code Formatter
43+
id: black
44+
run: |
45+
pip install black
46+
black .
47+
git diff --quiet && git diff --staged --quiet
48+
has_changed=$?
49+
echo "::set-output name=has_changed::$has_changed"
50+
echo $has_changed
51+
- name: Commit black changes
52+
if: steps.black.outputs.has_changed == 1
53+
run: |
54+
git config --global user.name 'Felix Andreas'
55+
git config --global user.email '[email protected]'
56+
git remote set-url origin https://x-access-token:${{ secrets.REPO_ACCESS_TOKEN }}@github.com/${{ github.repository }}
57+
git commit -am "Automated Code Formatting using Black"
58+
git push

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Set up Python
13+
uses: actions/setup-python@v1
14+
with:
15+
python-version: '3.7'
16+
- name: Install dependencies
17+
run: |
18+
python -m pip install --upgrade pip
19+
pip install setuptools wheel twine
20+
- name: Build and publish
21+
env:
22+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
23+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
24+
run: |
25+
python setup.py sdist bdist_wheel
26+
twine upload dist/*

.gitignore

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1-
# Byte-compiled / optimized / DLL files
1+
# OS and IDE
2+
.DS_Store
3+
.idea
4+
.vscode
5+
6+
# Byte-compiled / optimized / DLL files / Cache
27
__pycache__/
38
*.py[cod]
9+
*$py.class
10+
.pytest_cache/
11+
.mypy_cache/
12+
13+
# Distribution / packaging
14+
.Python
15+
build/
16+
dist/
17+
sdist/
18+
wheels/
19+
*.egg
20+
*.egg-info/

0 commit comments

Comments
 (0)