From 87d0f218045f659a1e5b5684228dcb68ddfa6691 Mon Sep 17 00:00:00 2001 From: houshmand-2005 Date: Mon, 20 May 2024 20:15:43 +0330 Subject: [PATCH] Add github action files --- .github/workflows/main.yml | 48 ++++++++++++++++++++++++++++++++++++ .github/workflows/pylint.yml | 23 +++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..0c50402 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,48 @@ +name: Build and Upload V2IpLimit + +on: + push: + paths: + - "v2iplimit.py" + +jobs: + build: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + + steps: + - name: Check-out repository + uses: actions/checkout@v3 + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + cache: "pip" + cache-dependency-path: | + **/requirements*.txt + + - name: Install your Dependencies + run: | + pip install -r requirements.txt + - name: Build Executable with Nuitka + uses: Nuitka/Nuitka-Action@main + with: + nuitka-version: main + script-name: v2iplimit.py + standalone: true + onefile: true + follow-imports: true + include-plugin-directory: "utils" + include-package: "websockets,logging" + python-flag: "-OO" + + - name: Upload Artifacts + uses: actions/upload-artifact@v3 + with: + name: ${{ runner.os }}_amd64_build + path: | + build/*.bin + build/*.exe diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..6ea7a10 --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,23 @@ +name: Pylint + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ["3.11", "3.12"] + steps: + - 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 + pip install pylint + - name: Analyzing the code with pylint + run: | + pylint $(git ls-files '*.py')