diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a72e479..04f3e30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,7 @@ name: Release EXE on: push: branches: [ "main" ] + workflow_dispatch: # Добавьте это событие для ручного запуска permissions: contents: write @@ -28,7 +29,13 @@ jobs: python -m pip install --upgrade pip pip install poetry poetry install - + + # 4. Set PYTHONPATH and Install Pyqt + - name: Set PYTHONPATH and Install Pyqt + run: | + set PYTHONPATH=%GITHUB_WORKSPACE%\PIDSimulations + pip install pyqt6 + # 4. Install PyInstaller - name: Install PyInstaller run: | @@ -37,7 +44,21 @@ jobs: # 5. Build the executable with PyInstaller - name: Build executable with PyInstaller run: | - poetry run pyinstaller src/gui/main.py --onefile --name main.exe + pyinstaller src/gui/main.py --onefile --name pid-sim.exe --paths "C:\\hostedtoolcache\\windows\\Python\\3.12.7\\x64\\Lib\\site-packages\\PyQt6\\Qt6\\plugins;PyQt6/Qt6/plugins" --clean + + # 6. Verify the build (optional) + - name: Verify executable + run: | + if (!(Test-Path "dist\pid-sim.exe")) { + Write-Error "Executable not found!" + exit 1 + } + + # 7. Display directory structure for debugging (optional) + - name: Display directory structure + run: | + dir dist + shell: cmd # 8. Create Release and Upload EXE - name: Create Release and Upload EXE @@ -47,4 +68,4 @@ jobs: tag_name: "release-${{ github.run_number }}" files: "dist/pid-sim.exe" env: - GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }} \ No newline at end of file