Skip to content

Commit

Permalink
Merge pull request #1 from mietzen/fritzos-7.56
Browse files Browse the repository at this point in the history
Fritzos 7.56
  • Loading branch information
mietzen authored Aug 1, 2023
2 parents 2f9299c + 03575a1 commit b995070
Show file tree
Hide file tree
Showing 7 changed files with 279 additions and 149 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Python Lint

on:
pull_request:
branches:
- 'main'

jobs:
Test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with ruff
env:
PY_VER: ${{ matrix.python-version }}
run: |
# stop the build if there are Python syntax errors or undefined names
PY_VER=$(echo py${PY_VER} | tr -d '.')
ruff --format=github --ignore=E501 --exclude=__init__.py --target-version=${PY_VER} .
Check-Test:
if: ${{ always() }}
runs-on: ubuntu-latest
needs:
- Test
steps:
- run: |
result="${{ needs.Test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
50 changes: 50 additions & 0 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build & Upload Python Package

on:
release:
types: [published]

jobs:
Setup:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set-version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get Version
id: set-version
env:
VERSION: ${{ github.ref_name }}
run: |
if grep -c -E '^v[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}$' <<< ${VERSION}; then
VERSION=$(sed 's/^.\{1\}//g' <<< ${VERSION})
else
echo "This branch shouldn't be build: ${VERSION}"
exit 1
fi
echo "version=$(echo ${VERSION})" >> $GITHUB_OUTPUT
Deploy:
runs-on: ubuntu-latest
needs: Setup
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
env:
VERSION: ${{ needs.Setup.outputs.version }}
run: python -m build --wheel
- name: Publish package
uses: pypa/[email protected]
with:
password: ${{ secrets.PYPI_API_TOKEN }}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ But with any FritzOS upgrade this library might stop working, don't uses this if
| Device | Tested in FritzOS |
|:--------------:|:-----------------:|
| FRITZ!DECT 301 | 7.29 |
| FRITZ!DECT 301 | 7.56 |

If you have a different device or FritzOS version set `experimental=True` this will disable all checks, but beware there might be dragons!

Expand Down
Loading

0 comments on commit b995070

Please sign in to comment.