From eece0b3fc9d1be7970a4c13c45a269624adc67b2 Mon Sep 17 00:00:00 2001 From: Ewy Date: Sun, 3 Mar 2024 02:37:15 +0100 Subject: [PATCH] feat: testing another new workflow --- .github/workflows/main.yml | 96 ++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 51 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 02eb2be..b26d67c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,56 +1,50 @@ name: Build with PyInstaller on: - push: - branches: - - master - pull_request: - branches: - - master + push: + branches: + - master + pull_request: + branches: + - master jobs: - build: - name: Build on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [windows-latest, macos-latest, ubuntu-latest] - python-version: [3.11] # You can change the Python version as needed - - steps: - - name: Checkout code - uses: actions/checkout@v2 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt # Modify this command as per your requirements - - - name: Build with PyInstaller - run: | - pyinstaller --onefile --name counter_phisher --icon assets/images/fish.ico counter_phisher.py - # Adjusted for different operating systems - if ($env:GITHUB_RUNNER_OS -eq "Windows") - { - mv dist\counter_phisher.exe dist\counter_phisher_windows.exe - } - elseif ($env:GITHUB_RUNNER_OS -eq "macOS") - { - mv dist/counter_phisher dist/counter_phisher_mac - } - else - { - mv dist/counter_phisher dist/counter_phisher_linux - } - - - name: Archive artifact - uses: actions/upload-artifact@v2 - with: - name: counter_phisher - path: dist/counter_phisher* # Adjusted to include files with extensions + build: + name: Build on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ windows-latest, macos-latest, ubuntu-latest ] + python-version: [ 3.11 ] + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Build with PyInstaller + run: | + if [ ${{ matrix.os }} == 'windows-latest' ]; then + pyinstaller --onefile --name counter_phisher.exe counter_phisher.py + elif [ ${{ matrix.os }} == 'macos-latest' ]; then + pyinstaller --onefile --name counter_phisher.app counter_phisher.py + elif [ ${{ matrix.os }} == 'ubuntu-latest' ]; then + pyinstaller --onefile --name counter_phisher counter_phisher.py + else + echo "Unsupported OS" + exit 1 + fi + - name: Upload artifact + uses: actions/upload-artifact@v2 + with: + name: counter_phisher + path: dist/counter_phisher \ No newline at end of file