# Yowie IT - RustDesk patched-binary build pipeline # ===================================================================== # Builds the Sciter-UI rustdesk.exe with our get_cursor() patch for # upstream issue #672 (always emit cursor data on Windows endpoints # regardless of physical mouse presence). # # Self-hosted Windows runner: yowie-admin-pc. # Toolchain version pins match upstream rustdesk CI (LLVM 16.0.0, vcpkg # at 120deac3, Rust stable). name: Build patched rustdesk.exe on: push: branches: [yowie-master] workflow_dispatch: env: LLVM_VERSION: "16.0.0" VCPKG_COMMIT_ID: "120deac3062162151622ca4860575a33844ba10b" CARGO_BIN: 'C:\Users\Yowie\.cargo\bin' # VCPKG_ROOT must be visible to cargo (magnum-opus + scrap build.rs read # it directly via env::var). GITHUB_ENV from a previous step doesn't # always propagate reliably under act_runner -- set at workflow level. VCPKG_ROOT: 'C:\vcpkg' LIBCLANG_PATH: 'C:\LLVM16\bin' jobs: build: name: Build Win x64 (Sciter UI) runs-on: windows-x64 steps: - name: Checkout source uses: actions/checkout@v4 with: submodules: recursive - name: Verify Rust toolchain shell: powershell run: | & "$env:CARGO_BIN\rustc.exe" --version & "$env:CARGO_BIN\cargo.exe" --version - name: Setup LLVM 16 (pre-staged on runner host) shell: powershell run: | # LLVM 16.0.0 is pre-staged at C:\LLVM16 on yowie-admin-pc. # Bootstrap path documented in feedback memory file (extracted # from LLVM-16.0.0-win64.exe NSIS installer via choco's 7z.exe). # Re-running NSIS install on every CI run was infeasible: the # LLVM win64.exe demands UAC elevation even with /S, and there # is no Windows tar.xz asset for LLVM 16 (only NSIS). if (-not (Test-Path 'C:\LLVM16\bin\libclang.dll')) { throw "LLVM 16 not pre-staged on runner; expected C:\LLVM16\bin\libclang.dll. Re-run runner-bootstrap script." } $sz = (Get-Item 'C:\LLVM16\bin\libclang.dll').Length Write-Output "libclang.dll: $([math]::Round($sz/1MB,2)) MB" & 'C:\LLVM16\bin\clang.exe' --version | Select-Object -First 1 echo "LIBCLANG_PATH=C:\LLVM16\bin" >> $env:GITHUB_ENV echo "C:\LLVM16\bin" >> $env:GITHUB_PATH - name: Setup vcpkg pinned commit shell: powershell run: | if (-not (Test-Path 'C:\vcpkg\vcpkg.exe')) { git clone https://github.com/microsoft/vcpkg.git C:\vcpkg } Push-Location C:\vcpkg git fetch --depth=200 origin $env:VCPKG_COMMIT_ID git checkout $env:VCPKG_COMMIT_ID .\bootstrap-vcpkg.bat -disableMetrics Pop-Location echo "VCPKG_ROOT=C:\vcpkg" >> $env:GITHUB_ENV echo "C:\vcpkg" >> $env:GITHUB_PATH - name: Install vcpkg native deps shell: powershell run: | # Force classic mode -- the repo has a vcpkg.json that pulls # in ffmpeg+amf+nvcodec+qsv (hwcodec) which is a 2hr build and # not needed for Sciter UI. The CLI flag --feature-flags is # ignored by some vcpkg versions when manifest is auto-detected; # env var VCPKG_FEATURE_FLAGS=-manifests is honored reliably. # Also run from C:\ so vcpkg's upward-walk can't find the # repo's vcpkg.json. $env:VCPKG_FEATURE_FLAGS = "-manifests" Push-Location C:\ try { C:\vcpkg\vcpkg.exe install --triplet x64-windows-static libvpx libyuv opus aom libjpeg-turbo if ($LASTEXITCODE -ne 0) { throw "vcpkg install failed (exit $LASTEXITCODE)" } } finally { Pop-Location } - name: Generate src/ui/inline.rs (Sciter UI assets) shell: powershell run: | # Sciter UI build embeds HTML/CSS/TIS assets at compile time # via a generated src/ui/inline.rs. Upstream rustdesk runs # res/inline-sciter.py during CI; we mirror that here. $py = 'C:\Users\Yowie\miniconda3\python.exe' if (-not (Test-Path $py)) { $py = (Get-Command python.exe -ErrorAction SilentlyContinue).Source } if (-not $py) { throw "no python.exe found on runner" } Write-Output "using python: $py" & $py res/inline-sciter.py if ($LASTEXITCODE -ne 0) { throw "inline-sciter.py failed (exit $LASTEXITCODE)" } if (-not (Test-Path 'src/ui/inline.rs')) { throw "inline.rs not generated" } Write-Output "inline.rs: $((Get-Item 'src/ui/inline.rs').Length) bytes" - name: cargo build --release (Sciter UI) shell: powershell run: | # Use --features inline (NOT --no-default-features) -- the # default feature set includes use_dasp which is required by # src/server/audio_service.rs (audio_resample). Run #12 # caught: --no-default-features stripped use_dasp causing # compile errors E0433/E0425. & "$env:CARGO_BIN\cargo.exe" build --release --features inline - name: Verify binary + patch marker shell: powershell run: | $exe = "target\release\rustdesk.exe" if (-not (Test-Path $exe)) { throw "rustdesk.exe not produced" } $size = (Get-Item $exe).Length Write-Output "rustdesk.exe size: $size bytes" if (-not (Select-String -Path "src\platform\windows.rs" -Pattern "Yowie IT MSP fork" -Quiet)) { throw "patch marker missing from src\platform\windows.rs" } - name: Upload artifact uses: actions/upload-artifact@v3 with: name: rustdesk-yowie-windows-x64 path: target/release/rustdesk.exe retention-days: 30 - name: Publish Gitea release (stable URL for OnRamp + Apply-YowieRustDeskPatch.sh) shell: powershell env: RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} run: | $tag = "build-$($env:GITHUB_SHA.Substring(0,7))-$(Get-Date -Format yyyyMMddHHmm)" $body = @{ tag_name = $tag target_commitish = "yowie-master" name = "Yowie patched rustdesk.exe ($tag)" body = "Automated build from CI. Patch: get_cursor() always emits IDC_ARROW (issue #672). SHA: $env:GITHUB_SHA" draft = $false prerelease = $false } | ConvertTo-Json -Compress $headers = @{ "Authorization" = "token $env:RELEASE_TOKEN"; "Content-Type" = "application/json" } $rel = Invoke-RestMethod -Uri "https://git.yowieit.com/api/v1/repos/infra/rustdesk-yowie/releases" -Method Post -Headers $headers -Body $body Write-Output "release id: $($rel.id), tag: $($rel.tag_name)" # Upload rustdesk.exe as release asset via curl.exe (Win 10+ bundled) # -- PowerShell multipart binary handling is fragile; curl.exe -F is bulletproof. $assetUri = "https://git.yowieit.com/api/v1/repos/infra/rustdesk-yowie/releases/$($rel.id)/assets?name=rustdesk.exe" & curl.exe -sk -X POST ` -H "Authorization: token $env:RELEASE_TOKEN" ` -F "attachment=@target/release/rustdesk.exe" ` "$assetUri" Write-Output "" Write-Output "release asset URL: https://git.yowieit.com/infra/rustdesk-yowie/releases/download/$tag/rustdesk.exe"