diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml new file mode 100644 index 0000000..e37085c --- /dev/null +++ b/.github/workflows/python-app.yml @@ -0,0 +1,60 @@ +# This workflow will install Python dependencies, run tests and lint with a single version of Python +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Python application + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + # - name: Test with pytest + # run: | + # pytest + + - name: Package tow Windows + uses: JackMcKew/pyinstaller-action-windows@main + with: + path: ./ + spec: tow.spec + requirements: requirements.txt + + - uses: actions/upload-artifact@v2 + with: + name: tow-windows + path: src/dist/windows + + - name: Package tow Linux + uses: JackMcKew/pyinstaller-action-linux@main + with: + path: ./ + spec: tow.spec + requirements: requirements.txt + + - uses: actions/upload-artifact@v2 + with: + name: tow-linux + path: src/dist/linux diff --git a/.gitignore b/.gitignore index c18dd8d..233eebd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ __pycache__/ + +build/ +dist/ \ No newline at end of file diff --git a/tow.spec b/tow.spec new file mode 100644 index 0000000..33ff853 --- /dev/null +++ b/tow.spec @@ -0,0 +1,40 @@ +# -*- mode: python ; coding: utf-8 -*- + + +block_cipher = None + + +a = Analysis(['tow.py'], + pathex=['./'], + binaries=[], + datas=[], + hiddenimports=[], + hookspath=[], + hooksconfig={}, + runtime_hooks=[], + excludes=[], + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False) +pyz = PYZ(a.pure, a.zipped_data, + cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + [], + name='tow', + debug=False, + bootloader_ignore_signals=False, + strip=False, + upx=True, + upx_exclude=[], + runtime_tmpdir=None, + console=True, + disable_windowed_traceback=False, + target_arch=None, + codesign_identity=None, + entitlements_file=None )