Skip to content

documentation

documentation #24

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Build Binary
concurrency: production
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # Push events to every tag not containing /
jobs:
build-linux:
runs-on: ubuntu-latest
permissions: write-all
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install -e .[dev]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --ignore=W191 --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 --ignore=W191 --max-complexity=15 --max-line-length=127 --statistics
- name: Build binary
run: pyinstaller -F src/net_diag/network_discover.py
- name: Package binary
run: |
cp README.md LICENSE.md dist/
tar -czf net_diag-linux-x86_64-${{ github.ref_name }}.tgz -C dist network_discover README.md LICENSE.md
- name: Create release
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release create ${{ github.ref_name }} -d -F RELEASE.md --title "Network Diagnostics ${{ github.ref_name }}"
- name: Upload release
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} --clobber net_diag-linux-${{ github.ref_name }}.tgz
build-windows:
runs-on: windows-latest
permissions: write-all
strategy:
fail-fast: false
matrix:
python-version: [ "3.10" ]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install -e .[dev]
- name: Build binary
run: pyinstaller -F src/net_diag/network_discover.py
- name: Package binary
run: |
Compress-Archive -DestinationPath net_diag-windows-x86_64-${{ github.ref_name }}.zip -LiteralPath dist/network_discover.exe, README.md, LICENSE.md
- name: Upload release
env:
GITHUB_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} --clobber net_diag-windows-${{ github.ref_name }}.zip