Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauszus committed Jan 24, 2024
0 parents commit 350a0ff
Show file tree
Hide file tree
Showing 11 changed files with 1,846 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Explicitly declare text files you want to always be normalized and converted to native line endings on checkout.
*.txt text
*.csv text
*.py text
*.kv text
*.ini text
*.md text
*.sh text
*.service text
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: CI

on: [push]

jobs:
checks:
name: Checks
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Cache pip
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-3.8-${{ hashFiles('requirements.txt') }}
- name: Update pip
run: pip install .[extra]
- name: Check formatting with Black
run: black --check --diff .
- name: Lint with flake8
run: flake8 .
- name: Static type checking
run: |
# Use mypy for static type checking
mkdir -p .mypy_cache # Workaround issue with mypy: https://github.com/tk-woven/mypy-install-types-mre
mypy --install-types --non-interactive .
dist:
name: Build dist
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
pip install -U pip setuptools wheel
pip install -U build
- name: Build dist
run: python -m build --sdist --wheel
- name: Upload dist as artifact
uses: actions/upload-artifact@v4
with:
name: pybldc-${{ github.sha }}
path: dist
release:
needs: [checks, dist]
name: Release
runs-on: ubuntu-22.04
timeout-minutes: 5
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: actions/download-artifact@v4
with:
name: pybldc-${{ github.sha }}
path: pybldc
- name: Publish to PyPI server
id: pypi
run: |
pip install -U pip setuptools wheel
pip install -U twine
twine check pybldc/*
twine upload -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} pybldc/*
- name: Calculate checksums
run: |
pushd pybldc
sha256sum * > SHA256SUMS
popd
- name: Publish to Github Release
if: ${{ ! cancelled() && steps.pypi.conclusion == 'success' }}
uses: softprops/action-gh-release@v1
with:
files: pybldc/*
draft: true
fail_on_unmatched_files: true
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
*.pyc
.idea/
venv*/
.eggs/
*.egg-info/
build/
dist/
*.bin
__pycache__/
Loading

0 comments on commit 350a0ff

Please sign in to comment.