diff --git a/static/build_files/windows/client-win.spec b/static/build_files/windows/client-win.spec index 27269336..4b1555ce 100644 --- a/static/build_files/windows/client-win.spec +++ b/static/build_files/windows/client-win.spec @@ -1,5 +1,12 @@ # -*- mode: python ; coding: utf-8 -*- +import cloudscraper +import cv2 +import os +import glob +cloudscraper_dir = os.path.dirname( cloudscraper.__file__ ) +cv2_ffmpeg_dll = glob.glob(os.path.dirname( cv2.__file__ )+"/*.dll")[0] + block_cipher = None @@ -17,9 +24,14 @@ a = Analysis(['hydrus\\client.pyw'], ('hydrus\\license.txt', '.'), ('hydrus\\Readme.txt', '.'), ('hydrus\\help my client will not boot.txt', '.'), - ('hydrus\\db', 'db') + ('hydrus\\db', 'db'), + ('hydrus\\hydrus', 'hydrus'), + ('hydrus\\sqlite3.dll', '.'), + ('hydrus\\mpv-1.dll', '.'), + (cloudscraper_dir, 'cloudscraper'), + (cv2_ffmpeg_dll, '.') ], - hiddenimports=['hydrus\\server.py'], + hiddenimports=['hydrus\\server.py', 'cloudscraper'], hookspath=[], runtime_hooks=[], excludes=[], diff --git a/static/build_files/windows/requirements.txt b/static/build_files/windows/requirements.txt new file mode 100644 index 00000000..b7f443eb --- /dev/null +++ b/static/build_files/windows/requirements.txt @@ -0,0 +1,27 @@ +PyWin32 +pypiwin32 +pywin32-ctypes +pefile +beautifulsoup4>=4.0.0 +chardet>=3.0.4 +cloudscraper>=1.2.33 +html5lib>=1.0.1 +lxml>=4.5.0 +lz4>=3.0.0 +nose>=1.3.0 +numpy>=1.16.0 +opencv-python-headless>=4.0.0 +Pillow>=6.0.0 +psutil>=5.0.0 +pylzma>=0.5.0 +pyOpenSSL>=19.1.0 +PySide2>=5.15.0 +PySocks>=1.7.0 +python-mpv>=0.4.5 +PyYAML>=5.0.0 +QtPy>=1.9.0 +requests==2.23.0 +Send2Trash>=1.5.0 +service-identity>=18.1.0 +six>=1.14.0 +Twisted>=20.3.0 diff --git a/static/build_files/windows/sqlite3.dll b/static/build_files/windows/sqlite3.dll new file mode 100644 index 00000000..96f319bc Binary files /dev/null and b/static/build_files/windows/sqlite3.dll differ diff --git a/static/build_files/windows/windows_build.yml b/static/build_files/windows/windows_build.yml index 471dd323..e66e5411 100644 --- a/static/build_files/windows/windows_build.yml +++ b/static/build_files/windows/windows_build.yml @@ -12,7 +12,8 @@ jobs: uses: actions/checkout@v2 with: path: hydrus - - uses: FedericoCarboni/setup-ffmpeg@v1 + - name: Setup FFMPEG + uses: FedericoCarboni/setup-ffmpeg@v1 id: setup_ffmpeg with: token: ${{ secrets.GITHUB_TOKEN }} @@ -22,10 +23,10 @@ jobs: python-version: 3.8 architecture: x64 - name: Cache Qt - id: cache-qt - uses: actions/cache@v2.1.4 + id: cache_qt + uses: actions/cache@v1 with: - path: Qt + path: ../Qt key: ${{ runner.os }}-QtCache - name: Install Qt uses: jurplel/install-qt-action@v2 @@ -33,15 +34,27 @@ jobs: install-deps: true setup-python: 'false' modules: qtcharts qtwidgets qtgui qtcore - cached: ${{ steps.cache-qt.outputs.cache-hit }} - - name: Pip Installer + cached: ${{ steps.cache_qt.outputs.cache-hit }} + - name: PIP Install Packages uses: BSFishy/pip-action@v1 with: packages: pyinstaller - requirements: hydrus\requirements.txt - - name: build with pyinstaller + requirements: hydrus\static\build_files\windows\requirements.txt + - name: Download mpv-dev + uses: carlosperate/download-file-action@v1.0.3 + id: download_mpv + with: + file-url: 'https://sourceforge.net/projects/mpv-player-windows/files/libmpv/mpv-dev-x86_64-20210228-git-d1be8bb.7z' + file-name: 'mpv-dev-x86_64.7z' + location: '.' + - name: Process mpv-dev + run: | + 7z x ${{ steps.download_mpv.outputs.file-path }} + move mpv-1.dll hydrus\ + - name: Build Hydrus run: | move ${{ steps.setup_ffmpeg.outputs.ffmpeg-path }} hydrus\bin\ + move hydrus\static\build_files\windows\sqlite3.dll hydrus\ move hydrus\static\build_files\windows\client-win.spec client-win.spec move hydrus\static\build_files\windows\server-win.spec server-win.spec pyinstaller server-win.spec @@ -51,15 +64,17 @@ jobs: run: | move hydrus\static\build_files\windows\InnoSetup.iss InnoSetup.iss ISCC.exe InnoSetup.iss - - name: Upload a Build Artifact - uses: actions/upload-artifact@v2 - with: - name: Windows-Extract - path: dist\Hydrus Network - name: Upload a Build Artifact uses: actions/upload-artifact@v2 with: name: Windows-Install path: dist\HydrusInstaller.exe if-no-files-found: error + retention-days: 2 + - name: Upload a Build Artifact + uses: actions/upload-artifact@v2 + with: + name: Windows-Extract + path: dist\Hydrus Network + if-no-files-found: error retention-days: 2 \ No newline at end of file